EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: Aethelstan on December 01, 2018, 02:13:36 pm

Title: Digital Signal Processing, stop bands and transition width.
Post by: Aethelstan on December 01, 2018, 02:13:36 pm
Hi, I am currently working on a DSP assignment for my degree and I have been having quite a bit of trouble meeting the required specification. I have double and triple checked my calculations, all my normalised values seem correct, cut-off frequencies are ok, attenuation is within expected values. However, I cannot for the life of me to get my transition width to match specified or calculated values. I'm not asking for anyone to tell me how to do it, but I do have one question that I cannot find an answer to, despite searching 5 books and Google seems to be letting me down.

Is it reasonable for the transition width to be greater than half of the stop-band width? As in, would having the transition widths overlapping be a legal or sane digital filter? If so, I will delve back into it and try to figure it out. If not, then it is likely that my filter will never work to specification and I need to write about that.

Thanks :)
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: the_eagle on December 01, 2018, 02:27:07 pm
Can you be more precise to describe your problem? What type of filter are you using? What is the sampling rate? What are the ideal parameters of your filter?

And, if you wish, can you show the calculations you have done so far?
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: Aethelstan on December 01, 2018, 02:50:18 pm
Thanks for the reply, I am creating a band stop filter with lower cut off of 1.5kHz, upper of 3.225kHz, passband ripple of <0.003dB, a transition width of 870Hz and a sampling rate of 16kHz. I am using a Kaiser window function with beta of 8.96. Normalised values are lower cut off of 0.09375, upper of 0.2015625, transition width of 0.054375, and these are calculated by dividing the prenormalised figures by the sampling frequency. I have calculated to number of coefficients required to be 105 by rearranging ∆F= 5.71/N which is given for the Kaiser window. My concern is that the lower and upper transition areas overlap in the centre of the stop band and hence interfere with each other. I'm about to try and draw it on a graph, and will attach it shortly. Every example I have seen in the books I have and even the lecture notes have a gap in between the upper and lower transition areas.
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: Marco on December 01, 2018, 03:06:53 pm
Yeah, if the transition bandwidth is that large you will get not get a "flat" bottom response.

Did a quick google for an example (https://medium.com/@savinihemachandra/fir-filter-design-bandstop-filter-17bdace6a54e) of how to design it with a flat bottom.
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: Aethelstan on December 01, 2018, 03:23:33 pm
Cheers, that's very useful. I can use that to show that the upper stop band edge is lower that the lower stop band edge, which I think would be an invalid filter specification. :)
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: Marco on December 01, 2018, 04:07:40 pm
Depends, not all band stop filters have a flat bottom. Sometimes a single sharp notch is the best you can do.
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: bson on December 01, 2018, 08:48:05 pm
Cheers, that's very useful. I can use that to show that the upper stop band edge is lower that the lower stop band edge, which I think would be an invalid filter specification. :)
Well, depends on the required minimum stop band attenuation...

(What Marco said. :))
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: mark03 on December 02, 2018, 01:17:00 am
I think you are misunderstanding the definition of "transition band."  Unless directed otherwise, you should assume that the transitions are *centered* on the nominal cutoff frequencies.  When you do this, the transition bands do not overlap.  You have (for the ideal filter):

Passband ends, lower transition begins  1500 - 870/2 = 1065 Hz
Lower transition ends, stopband begins  1500 + 870/2 = 1935 Hz
Stopband ends, upper transition begins  3225 - 870/2 = 2790 Hz
Upper transition ends, passband resumes  3225 + 870/2 = 3660 Hz

Remember that when you use a window design method, the resulting frequency response is a perfect brick wall from your infinite sinc, convolved with the frequency response of your window (which includes truncation).  This convolution turns the brick walls into finite-slope transitions, but it should not move them from their nominal positions.  So the sinc portion of your formula for the filter coefficients, which is the only place in the formula where the bandwidth appears, will use the nominal bandwidth (3225 - 1500), not some figure which has already been adjusted for the transition widths.
Title: Re: Digital Signal Processing, stop bands and transition width.
Post by: Aethelstan on December 06, 2018, 11:52:03 am
Hi Mark, thank you for your reply. I was indeed misunderstanding where the transition starts and ends, so thank you for that. It set me on the right track to uncover a couple of other mistakes I had made, and I now think I have a greater understanding of the subject matter.