DSPRelated.com
Forums

FIR windowing design

Started by pinkisntwell December 9, 2009
Let's say I decide on a desired frequency response, for example a
highpass filter with zero phase. I can then take the samples of that
frequency response and take their inverse DFT to get the impulse
response of a truncated IIR system, essentially windowed with the
rectangular window. I can then calculate its frequency response and
plot it: http://i47.tinypic.com/vrg941.png

If I apply the Hanning window to that impulse response (so the peak of
the Hanning window is in the middle of my impulse response, as
described by Oppenheim) the frequency response is unsatisfactory:
http://i50.tinypic.com/103wktu.jpg

I need to circularly shift the impulse response by roughly N/2, where
N the length of the response, to get a satisfying result:
http://i50.tinypic.com/2ly036d.png

Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't
mention this problem.

Your window is way too short for desired response.

VLV



pinkisntwell wrote:

> Let's say I decide on a desired frequency response, for example a > highpass filter with zero phase. I can then take the samples of that > frequency response and take their inverse DFT to get the impulse > response of a truncated IIR system, essentially windowed with the > rectangular window. I can then calculate its frequency response and > plot it: http://i47.tinypic.com/vrg941.png > > If I apply the Hanning window to that impulse response (so the peak of > the Hanning window is in the middle of my impulse response, as > described by Oppenheim) the frequency response is unsatisfactory: > http://i50.tinypic.com/103wktu.jpg > > I need to circularly shift the impulse response by roughly N/2, where > N the length of the response, to get a satisfying result: > http://i50.tinypic.com/2ly036d.png > > Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't > mention this problem.
On Dec 10, 4:26&#4294967295;am, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> Your window is way too short for desired response. >
Then how come my final frequency response looks fine?
On 10 Des, 04:03, pinkisntwell <pinkisntw...@gmail.com> wrote:
> Let's say I decide on a desired frequency response, for example a > highpass filter with zero phase. I can then take the samples of that > frequency response and take their inverse DFT to get the impulse > response of a truncated IIR system, essentially windowed with the > rectangular window.
> Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't > mention this problem.
Just out of curiosity - where does Oppenheim and Schafer (or anyone else, for that matter) mention FIR design by window-weighted impulse responses? Rune
On Dec 10, 11:57&#4294967295;am, Rune Allnor <all...@tele.ntnu.no> wrote:
> On 10 Des, 04:03, pinkisntwell <pinkisntw...RA@gmail.com> wrote: > > > Let's say I decide on a desired frequency response, for example a > > highpass filter with zero phase. I can then take the samples of that > > frequency response and take their inverse DFT to get the impulse > > response of a truncated IIR system, essentially windowed with the > > rectangular window. > > Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't > > mention this problem. > > Just out of curiosity - where does Oppenheim and Schafer > (or anyone else, for that matter) mention FIR design by > window-weighted impulse responses? > > Rune
In Discrete-Time Signal Processing, Second Edition, section 7.2, "Design of FIR Filters by Windowing".
On 10 Des, 13:24, pinkisntwell <pinkisntw...@gmail.com> wrote:
> On Dec 10, 11:57=A0am, Rune Allnor <all...@tele.ntnu.no> wrote: > > > On 10 Des, 04:03, pinkisntwell <pinkisntw.....@gmail.com> wrote: > > > > Let's say I decide on a desired frequency response, for example a > > > highpass filter with zero phase. I can then take the samples of that > > > frequency response and take their inverse DFT to get the impulse > > > response of a truncated IIR system, essentially windowed with the > > > rectangular window. > > > Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't > > > mention this problem. > > > Just out of curiosity - where does Oppenheim and Schafer > > (or anyone else, for that matter) mention FIR design by > > window-weighted impulse responses? > > > Rune > > In Discrete-Time Signal Processing, Second Edition, section 7.2, > "Design of FIR Filters by Windowing".
Where does it say that the impulse response comes from an IIR system? Rune
On 10 Des, 13:24, pinkisntwell <pinkisntw...@gmail.com> wrote:
> On Dec 10, 11:57&#4294967295;am, Rune Allnor <all...@tele.ntnu.no> wrote: > > > On 10 Des, 04:03, pinkisntwell <pinkisntw.....@gmail.com> wrote: > > > > Let's say I decide on a desired frequency response, for example a > > > highpass filter with zero phase. I can then take the samples of that > > > frequency response and take their inverse DFT to get the impulse > > > response of a truncated IIR system, essentially windowed with the > > > rectangular window. > > > Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't > > > mention this problem. > > > Just out of curiosity - where does Oppenheim and Schafer > > (or anyone else, for that matter) mention FIR design by > > window-weighted impulse responses? > > > Rune > > In Discrete-Time Signal Processing, Second Edition, section 7.2, > "Design of FIR Filters by Windowing".
Where does it say that the impulse response comes from an IIR system? Rune
pinkisntwell wrote:
> Let's say I decide on a desired frequency response, for example a > highpass filter with zero phase. I can then take the samples of that > frequency response and take their inverse DFT to get the impulse > response of a truncated IIR system, essentially windowed with the > rectangular window. I can then calculate its frequency response and > plot it: http://i47.tinypic.com/vrg941.png > > If I apply the Hanning window to that impulse response (so the peak of > the Hanning window is in the middle of my impulse response, as > described by Oppenheim) the frequency response is unsatisfactory: > http://i50.tinypic.com/103wktu.jpg > > I need to circularly shift the impulse response by roughly N/2, where > N the length of the response, to get a satisfying result: > http://i50.tinypic.com/2ly036d.png > > Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't > mention this problem.
The method of window-based FIR design that I'm more familiar with is the method of designing by windowing the sinc function. Steven Smith gives a very nice explanation of that in Chapter 16 of his book "The Scientist and Engineer's Guide to Digital Signal Processing", which is available online at http://www.dspguide.com/ch16.htm . The formulas are fairly simple to implement in the programming language of your choice. (Smith uses BASIC <silly-boy>.) Iowegian's ScopeFIR provides this as one of its FIR design methods, along with several others such as the much more popular Parks-McClellan. In my experience, the benefits of the windowed sync approach compared to PM are: 1) The filter can be designed directly by formula rather than by iteration: therefore, there's no possibility of the filter design process failing to converge; at worst, the filter doesn't meet your specifications. This might be important in embedded applications where the FIR response is designed on the fly. However, it's not important for the more common case where the filter is designed in advance and is fixed throughout the life of the system 2) You can have more gentle rolloff and can have monotonic responses. In that vein, one of my personal favorites <nerd-alert> is the Gaussian window. It's not a champion, but it's more gentle on the spectrum than Puffs tissues are on the nose <hoping-to-pick-up-Tiger-Woods'-lost-endorsements>. Grant -- _____________________________________________________________________ Grant R. Griffin Publisher of dspGuru http://www.dspguru.com Iowegian International Corporation http://www.iowegian.com See http://www.iowegian.com/img/contact.gif for e-mail address

pinkisntwell wrote:
> On Dec 10, 4:26 am, Vladimir Vassilevsky <nos...@nowhere.com> wrote: > >>Your window is way too short for desired response. >> > > > Then how come my final frequency response looks fine?
Your window is way too short for desired response, you STUPIDENT. VLV
On Dec 10, 12:44&#4294967295;pm, Rune Allnor <all...@tele.ntnu.no> wrote:
> On 10 Des, 13:24, pinkisntwell <pinkisntw...KS@gmail.com> wrote: > > > > > On Dec 10, 11:57&#4294967295;am, Rune Allnor <all...KF@tele.ntnu.no> wrote: > > > > On 10 Des, 04:03, pinkisntwell <pinkisntw.....KQ@gmail.com> wrote: > > > > > Let's say I decide on a desired frequency response, for example a > > > > highpass filter with zero phase. I can then take the samples of that > > > > frequency response and take their inverse DFT to get the impulse > > > > response of a truncated IIR system, essentially windowed with the > > > > rectangular window. > > > > Why is it so? In Discrete-Time Signal Processing Oppenheim doesn't > > > > mention this problem. > > > > Just out of curiosity - where does Oppenheim and Schafer > > > (or anyone else, for that matter) mention FIR design by > > > window-weighted impulse responses? > > > > Rune > > > In Discrete-Time Signal Processing, Second Edition, section 7.2, > > "Design of FIR Filters by Windowing". > > Where does it say that the impulse response comes from > an IIR system? > > Rune
If you want to help, by all means do so. If not, try to find something better to do than what you're doing right now. And yes, it does say so in the book, as the authors are windowing a "desired impulse response", most of the time corresponding to a bandpass filter, so said impulse response is infinite. If you want more info about the book, you can read it. Otherwise, shut the fuck up.