# How do you change an instance of dsp.DigitalDownConverter object in MATLAB to work with filters other than the ones it is originally defined with?

If you look at this website:

https://www.mathworks.com/help/dsp/ref/dsp.digitaldownconverter-system-object.html

you will see an example (with code) that attempts to up convert and down convert a sine wave. So at the bottom of the tutorial you will see 3 plots. The first shows the frequency spectrum of the sine wave, which has a frequency of 1 kHz. The second plot shows the frequency spectrum of the up converted sine wave, with a frequency of 50 kHz. The third plot shows a frequency spectrum of the down converted sine wave, which has the exact same frequency of the original sine wave( 1 kHz). So up and down converting appears to be working happily.

My question is, in the 4th plot, they show 3 different filters (or filter stages) within the ddc object (I believe the cic decimator, cic compensator, and halfband decimator). How can the ddc object be modified to use different filters? What if I want to use a low pass filter? Or a high pass filter? Or a butterworth filter? Am I not able to change this?

• Is there a reason you have to use the MATLAB system object? I think it is ok to go ahead and implement your own code if you know exactly what you need and the built-in functions aren't fitting your need – Engineer Apr 29 at 19:35
• @Engineer - No need to specifically use dsp.DigitalDownConverter object. But, generally speaking its never a good idea to reinvent the wheel, so if there is code in there that is reusable then i'd prefer to use the DDC object. Do you know where I can find examples that use different filters? – user1068636 Apr 29 at 19:38
• Agree with you on that one. I don't see anything on changing the filters, seems like they offer a few options but its not fully customizable. You could write a down-converter where you also pass the filter coefficients or something, that way you'd have more control – Engineer Apr 29 at 19:42
• is there an example of a down converter with a single filter? – user1068636 Apr 29 at 20:02
• Yeah, it is covered in a DSP book in the chapter where they talk about rate conversions usually – Engineer Apr 29 at 21:02