I have a switch decoder which gives DC pulse to the output.I want to connect a motor which works with AC current so how can i convert the DC to AC?
Not economicallly feasible. What, specifically, are you wanting to do with this motor? Depending on your intended use, a cheap AC transformer may be suitable.
Is the decoder designed to work with twin coil style switch machines? If so, the easiest thing to do would probably be to get an AC power supply for the motor and use an Atlas Snap Relay(https://secure.atlasrr.com/mod1/itemdesc.asp?CartId={B828A8B2-7C07-4EC2-9EVEREST173-81CD66080D05}&ic=0200&eq=&Tp=) triggered from the decoder to turn the motor on and off. The Snap Relay is basically an undertable switch machine without the actuating arm for the switch.
You would need an inverter and as Cacole stated, it isn’t feasable. I doubt whatever DC transformer you are using would have the power to deliver much through an inverter.
RV users will sometimes use inverters to power their ac appliances, but a generator is a much better idea.
Tilden
If your switch decoder has enough output power to pull a relay, you could use a latching relay to operate a set of contacts. You could then use the contacts on the latching relay to switch AC power from a small transformer.