DSPRelated.com
Forums

Why there are amplitude distortion for a single frequency signal passing through filter?

Started by Unknown February 6, 2013
I designed a bandpass filter under sptool of Matlab with the following specs:
1) Fs=25MHz,
2) fstop1=20MHz,
3) fpasss1=25MHz,
4) fpass2=30MHz,
5) fstop2=40MHz.
6) IIR Butterworth filter.

It gives me an IIR filter of 32-order. After that, I generated a sequence of single frequency signal of 3MHz and let this signal being filtered by the designed IIR filter. When I observed the flter's output signal, there are small variation at its amplitude. 

I understand that IIR filter has non-linear phase characteristic. Signal of different frequency when passes through it will suffer delay by different amount. And therefore, if a signal that is composed of more than one frequency component (frequency that is within the passband of the filter) when passes through the IIR filter, the output signal will not look the same as the input.

But in my case, why distortion exists when the signal of single frequency component passing through the IIR filter?
Try it with the same signal, except at half the amplitude.  If this helps, you may have too high an amplitude for the original signal at some point in the filter.
On Tue, 5 Feb 2013 22:10:40 -0800 (PST), yweesoon@gmail.com wrote:

>I designed a bandpass filter under sptool of Matlab with the following specs: >1) Fs=25MHz, >2) fstop1=20MHz, >3) fpasss1=25MHz, >4) fpass2=30MHz, >5) fstop2=40MHz. >6) IIR Butterworth filter. > >It gives me an IIR filter of 32-order. After that,
Hi, Wow. A 32-order IIR filter is *VERY* high order filter.
>I generated a sequence of >single frequency signal of 3MHz and let this signal being filtered by the >designed IIR filter.
You say you generated a pure tone whose frequency is 3 MHz. Is the "3" a typo? Do you really mean 3 MHz? Your words are a bit incorrect. You cannot "filter" a pure tone. You can filter a signal containing many tones of different frequencies, but you cannot filter a single tone. What you should say is, "I applied my 3 MHz tone to the input of a filter." The output of the filter will also be a 3 Mhz tone. The 3 MHz output tone will have a different peak amplitude compared to the peak amplitude of the input 3 Mhz tone, and the 3 Mhz output tone will be shifted in phase relative to the phase of the 3 MHz input tone.
>When I observed the flter's output signal, there are small variation at >its amplitude.
What does a "small variation at its amplitude" mean?
>I understand that IIR filter has non-linear phase characteristic. Signal of >different frequency when passes through it will suffer delay by different amount. >And therefore, if a signal that is composed of more than one frequency component >(frequency that is within the passband of the filter) when passes through the IIR >filter, the output signal will not look the same as the input.
That is correct.
>But in my case, why distortion exists when the signal of single frequency >component passing through the IIR filter?
What does the word "distortion" mean? If you gives us more specific details I imagine someone here can help you. [-Rick-]
On Wednesday, February 6, 2013 3:07:45 PM UTC+8, Rick Lyons wrote:
> On Tue, 5 Feb 2013 22:10:40 -0800 (PST), yweesoon@gmail.com wrote: > > > > >I designed a bandpass filter under sptool of Matlab with the following specs: > > >1) Fs=25MHz, > > >2) fstop1=20MHz, > > >3) fpasss1=25MHz, > > >4) fpass2=30MHz, > > >5) fstop2=40MHz. > > >6) IIR Butterworth filter. > > > > > >It gives me an IIR filter of 32-order. After that, > > Hi, > > Wow. A 32-order IIR filter is *VERY* > > high order filter. > > > > >I generated a sequence of > > >single frequency signal of 3MHz and let this signal being filtered by the > > >designed IIR filter. > > > > You say you generated a pure tone whose frequency is > > 3 MHz. Is the "3" a typo? Do you really mean 3 MHz? >
Yes, I mean 3 MHz pure tone frequency.
> > > Your words are a bit incorrect. You cannot "filter" a pure > > tone. You can filter a signal containing many tones of > > different frequencies, but you cannot filter a single > > tone. What you should say is, "I applied my 3 MHz tone > > to the input of a filter." >
Yes, I understand what you meant by cannot filter the pure tone frequency of 3 MHz signal. My purpose of doing this is for studying the of the IIR filter characteristic. I want to ensure that a pure tone signal that falls within the passband of an IIR filter after passing through it will only suffer delay and not other thing. However, I saw there is a variation in the output amplitude and this surprise me. Probably this example is still no so observe, I will give another example in a separate posting, thank you.
> > > The output of the filter > > will also be a 3 Mhz tone. The 3 MHz output tone will > > have a different peak amplitude compared to the peak > > amplitude of the input 3 Mhz tone, and the 3 Mhz output > > tone will be shifted in phase relative to the phase of > > the 3 MHz input tone. > > > > > > >When I observed the flter's output signal, there are small variation at > > >its amplitude. > > > > What does a "small variation at its amplitude" mean? > > > > >I understand that IIR filter has non-linear phase characteristic. Signal of > > >different frequency when passes through it will suffer delay by different amount. > > >And therefore, if a signal that is composed of more than one frequency component > > >(frequency that is within the passband of the filter) when passes through the IIR > > >filter, the output signal will not look the same as the input. > > > > That is correct. > > > > >But in my case, why distortion exists when the signal of single frequency > > >component passing through the IIR filter? > > > > What does the word "distortion" mean? > > > > If you gives us more specific details I imagine > > someone here can help you. > > > > [-Rick-]
On 06-02-2013 11:40, yweesoon@gmail.com wrote:
> I designed a bandpass filter under sptool of Matlab with the following specs: > 1) Fs=25MHz, > 2) fstop1=20MHz, > 3) fpasss1=25MHz, > 4) fpass2=30MHz, > 5) fstop2=40MHz. > 6) IIR Butterworth filter. > > It gives me an IIR filter of 32-order. After that, I generated a sequence of single frequency signal of 3MHz and let this signal being filtered by the designed IIR filter. When I observed the flter's output signal, there are small variation at its amplitude. > > I understand that IIR filter has non-linear phase characteristic. Signal of different frequency when passes through it will suffer delay by different amount. And therefore, if a signal that is composed of more than one frequency component (frequency that is within the passband of the filter) when passes through the IIR filter, the output signal will not look the same as the input. > > But in my case, why distortion exists when the signal of single frequency component passing through the IIR filter?
I think what you mention as "small variation at its amplitude" is what you are calling "distortion" later-on. I would suggest that you do not call this "distortion" when you are asking people, because distortion typically refers to a change in the wave shape. Here's what I think you should do: 1. Plot the gain magnitude versus frequency characteristics of your filter. 2. Multiply the value of the gain magnitude of the filter at 3 MHz by the amplitude of the input signal. 3. The value so obtained should be the same as the "observed" value. If these two values match, I think you are fine. If they don't, you need to check whether the pass band gain of the filter is as per your expectation. And also, it would help if you send some more details (code, plots etc.). All the best, Anand
On Tue, 05 Feb 2013 23:38:42 -0800, yweesoon wrote:

> On Wednesday, February 6, 2013 3:07:45 PM UTC+8, Rick Lyons wrote: >> On Tue, 5 Feb 2013 22:10:40 -0800 (PST), yweesoon@gmail.com wrote: >> >> >> >> >I designed a bandpass filter under sptool of Matlab with the following >> >specs: >> >> >1) Fs=25MHz, >> >> >2) fstop1=20MHz, >> >> >3) fpasss1=25MHz, >> >> >4) fpass2=30MHz, >> >> >5) fstop2=40MHz. >> >> >6) IIR Butterworth filter. >> >> >> > >> >It gives me an IIR filter of 32-order. After that, >> >> Hi, >> >> Wow. A 32-order IIR filter is *VERY* >> >> high order filter. >> >> >> >> >I generated a sequence of >> >> >single frequency signal of 3MHz and let this signal being filtered by >> >the >> >> >designed IIR filter. >> >> >> >> You say you generated a pure tone whose frequency is >> >> 3 MHz. Is the "3" a typo? Do you really mean 3 MHz? >> >> > Yes, I mean 3 MHz pure tone frequency. > > >> >> Your words are a bit incorrect. You cannot "filter" a pure >> >> tone. You can filter a signal containing many tones of >> >> different frequencies, but you cannot filter a single >> >> tone. What you should say is, "I applied my 3 MHz tone >> >> to the input of a filter." >> >> > Yes, I understand what you meant by cannot filter the pure tone > frequency of 3 MHz signal. My purpose of doing this is for studying the > of the IIR filter characteristic. I want to ensure that a pure tone > signal that falls within the passband of an IIR filter after passing > through it will only suffer delay and not other thing. However, I saw > there is a variation in the output amplitude and this surprise me. > Probably this example is still no so observe, I will give another > example in a separate posting, thank you.
Your stated passband is from 25MHz to 30MHz. 3MHz is way, way lower than your stated passband. If you were trying to run a 30MHz signal through the filter and everything else were working correctly I'd suspect ringing, which ought to die down. Did you implement the filter as 16 2nd-order filters in cascade, or one humongous 32nd order filter? If you did the humongous one, then chances are exceedingly high that you are running into numerical difficulties. In fact, if you did the humongous one I'm surprised that you're not asking why your filter output exploded, 'cause I'd expect that those numerical difficulties would include instability in such a filter. Even if you're running 16 2nd-order filters, I would expect so much attenuation at 3MHz that you'd be running into round-off errors, and seeing numerical "scrud" as a consequence. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
yweesoon@gmail.com writes:

> I designed a bandpass filter under sptool of Matlab with the following specs: > 1) Fs=25MHz, > 2) fstop1=20MHz, > 3) fpasss1=25MHz, > 4) fpass2=30MHz, > 5) fstop2=40MHz. > 6) IIR Butterworth filter.
I may be missing something here, but how can you have stop and passbands that are > Fs / 2? Are you trying to do bandpass sampling? Does Matlab's sptool support bandpass sampling specifications? -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On Wed, 06 Feb 2013 11:29:18 -0500, Randy Yates wrote:

> yweesoon@gmail.com writes: > >> I designed a bandpass filter under sptool of Matlab with the following >> specs: >> 1) Fs=25MHz, >> 2) fstop1=20MHz, >> 3) fpasss1=25MHz, >> 4) fpass2=30MHz, >> 5) fstop2=40MHz. >> 6) IIR Butterworth filter. > > I may be missing something here, but how can you have stop and passbands > that are > Fs / 2? Are you trying to do bandpass sampling? Does Matlab's > sptool support bandpass sampling specifications?
I missed that completely. Given that the OP is adamant that 3MHz (yes, 3.0MHz) is in the passband, perhaps he's off by a factor of 10 on his filter numbers? -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
Tim Wescott <tim@seemywebsite.please> writes:

> On Wed, 06 Feb 2013 11:29:18 -0500, Randy Yates wrote: > >> yweesoon@gmail.com writes: >> >>> I designed a bandpass filter under sptool of Matlab with the following >>> specs: >>> 1) Fs=25MHz, >>> 2) fstop1=20MHz, >>> 3) fpasss1=25MHz, >>> 4) fpass2=30MHz, >>> 5) fstop2=40MHz. >>> 6) IIR Butterworth filter. >> >> I may be missing something here, but how can you have stop and passbands >> that are > Fs / 2? Are you trying to do bandpass sampling? Does Matlab's >> sptool support bandpass sampling specifications? > > I missed that completely.
Thank you, thank you, thank you, Tim. With all these smart people in this group, being the only one to notice such a basic problem had me worried I had lost it! -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On Thursday, February 7, 2013 2:06:00 AM UTC+8, Randy Yates wrote:
> Tim Wescott <tim@seemywebsite.please> writes: > > > > > On Wed, 06 Feb 2013 11:29:18 -0500, Randy Yates wrote: > > > > > >> yweesoon@gmail.com writes: > > >> > > >>> I designed a bandpass filter under sptool of Matlab with the following > > >>> specs: > > >>> 1) Fs=25MHz, > > >>> 2) fstop1=20MHz, > > >>> 3) fpasss1=25MHz, > > >>> 4) fpass2=30MHz, > > >>> 5) fstop2=40MHz. > > >>> 6) IIR Butterworth filter. > > >> > > >> I may be missing something here, but how can you have stop and passbands > > >> that are > Fs / 2? Are you trying to do bandpass sampling? Does Matlab's > > >> sptool support bandpass sampling specifications? > > > > > > I missed that completely. > > > > Thank you, thank you, thank you, Tim. With all these smart people in > > this group, being the only one to notice such a basic problem had me > > worried I had lost it! > > -- > > Randy Yates > > Digital Signal Labs > > http://www.digitalsignallabs.com
I want to apologise to those who took the time to help me in answering my question. These include Robert Miles, Rick Lyons, Anand P. Paralkar, Tim Wescott, Randy Yates! The reason is reason I made terrible typo errors in my question regarding the specification. It should be as follows: 1) Fs=25MHz, 2) fstop1=2.0MHz, 3) fpasss1=2.5MHz, 4) fpass2=3.0MHz, 5) fstop2=4.0MHz. 6) IIR Butterworth filter. Please accept my apolpgize! Sorry about that!