Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform


Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Problem measuring frequency response of filters


There are 16 messages in this thread.

You are currently looking at messages 0 to 10.


Problem measuring frequency response of filters - Malcolm Haylock - 2004-01-26 05:19:00

Hi everyone,

I'm fairly new to DSP and am having trouble measuring the frequency 
response of various (mainly Butterworth) filters that I wish to use in a 
program.

To test the response I'm running the filters on white noise using a 1024 
point buffer (which is what the program will use) then taking the DFT of 
the output. I'm doing this 1000 times and averaging the result.

The results look fine apart from the lowest frequency response. I've 
tried using a Hamming window on the filter output before running the DFT 
but there is still the problem.

Is this a problem with the filter or the DFT or my (probably naive) 
approach.

Thanks,
Malcolm Haylock

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Atmapuri - 2004-01-26 08:52:00



Hi!

> I'm fairly new to DSP and am having trouble measuring the frequency
> response of various (mainly Butterworth) filters that I wish to use in a
> program.
>
> To test the response I'm running the filters on white noise using a 1024
> point buffer (which is what the program will use) then taking the DFT of
> the output. I'm doing this 1000 times and averaging the result.
>
> The results look fine apart from the lowest frequency response. I've
> tried using a Hamming window on the filter output before running the DFT
> but there is still the problem.
>
> Is this a problem with the filter or the DFT or my (probably naive)
> approach.

You have three options (that I can think of):

1.) Put a big single number (total number of points)
at the begining of the buffer and then filter the buffer.
Perform abs(FFT) on the entire buffer afterwards. The buffer
should be about 4000 samples
long. But try with longer lengths if the frequency response
 looks "strange". After some length it does not change anymore.
2.) Compute the FFT of the nominator and denominator separately.
Divide them in complex. Take the absolute value and thats it. This has
drawbacks and may
not be able to show frequency responses of the filters that you can get
to show with  method "1".  The number of points is from 1024 to 4096.
3.) What you are doing. Not bad, but very slow. You would get better
results if you used more points. That's probably why your low frequencies
have problems.

Regards!
Atmapuri.


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Randy Yates - 2004-01-26 09:30:00

Malcolm Haylock <s...@kagi.com> writes:

> Hi everyone,
>
> I'm fairly new to DSP and am having trouble measuring the frequency
> response of various (mainly Butterworth) filters that I wish to use in
> a program.
>
> To test the response I'm running the filters on white noise using a
> 1024 point buffer (which is what the program will use) then taking the
> DFT of the output. I'm doing this 1000 times and averaging the result.
>
> The results look fine apart from the lowest frequency response. I've
> tried using a Hamming window on the filter output before running the
> DFT but there is still the problem.

Hi Malcolm,

The N-point DFT creates N filters of width Fs/N.  Usually you want the
measurement points to vary nonlinearly as a function of frequency
(which is why you usually use a logarithmic frequency axis) when
you're measuring frequency response, so this is one aspect in which
the DFT doesn't quite match what you want to do. You wind up with lots
of bins at the high frequencies that you don't really need and not
enough bins at the low frequencies. Windowing won't help this problem.

You can simply increase the DFT size until you get the low frequency
resolution you need. Or you can go to an alternate measurement
technique. For example, you can generate sine waves and measure the
power out of the filter after steady-state has been reached.

This all applies to measuring a given filter implementation. If you
want to examine the response of a theoretical filter, simply use the
transfer function (H(z)) and solve for z = e^{j*w*Ts}. 
-- 
%  Randy Yates                  % "...the answer lies within your soul
%% Fuquay-Varina, NC            %       'cause no one knows which side
%%% 919-577-9882                %                   the coin will fall."
%%%% <y...@ieee.org>           %  'Big Wheels', *Out of the Blue*, ELO
http://home.earthlink.net/~yatescr
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Vladimir Vassilevsky - 2004-01-26 10:30:00

There is a new branch of science: experimental mathematics :)
I always loved it.

It does not make sense to measure the frequency response of the digital
filter since you have H(Z) determined by the filter stricture. The
|H(Z)| gives you the response in the clear analytical form.

If you insist on the experimental proof then use the delta function
instead of white noise.

Vladimir Vassilevsky
DSP Consultant

http://www.abvolt.com
  
  
Malcolm Haylock wrote:
> 
> Hi everyone,
> 
> I'm fairly new to DSP and am having trouble measuring the frequency
> response of various (mainly Butterworth) filters that I wish to use in a
> program.
> 
> To test the response I'm running the filters on white noise using a 1024
> point buffer (which is what the program will use) then taking the DFT of
> the output. I'm doing this 1000 times and averaging the result.
> 
> The results look fine apart from the lowest frequency response. I've
> tried using a Hamming window on the filter output before running the DFT
> but there is still the problem.
> 
> Is this a problem with the filter or the DFT or my (probably naive)
> approach.
> 
> Thanks,
> Malcolm Haylock
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Bhaskar Thiagarajan - 2004-01-26 14:45:00

"Malcolm Haylock" <s...@kagi.com> wrote in message
news:bv2pfu$pp2$1...@cpca14.uea.ac.uk...
> Hi everyone,
>
> I'm fairly new to DSP and am having trouble measuring the frequency
> response of various (mainly Butterworth) filters that I wish to use in a
> program.
>
> To test the response I'm running the filters on white noise using a 1024
> point buffer (which is what the program will use) then taking the DFT of
> the output. I'm doing this 1000 times and averaging the result.
>
> The results look fine apart from the lowest frequency response. I've
> tried using a Hamming window on the filter output before running the DFT
> but there is still the problem.
>
> Is this a problem with the filter or the DFT or my (probably naive)
> approach.
>
> Thanks,
> Malcolm Haylock

Try this link - should take you to a archived thread in Google groups that
talks about this topic
(else try searching yourself in google groups for a thread with subject
'filter freq response'.
http://tinyurl.com/yud6z

Cheers
Bhaskar


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Ronald H. Nicholson Jr. - 2004-01-26 19:10:00

In article <4...@there.com>,
Vladimir Vassilevsky  <d...@there.com> wrote:
>There is a new branch of science: experimental mathematics :)
>I always loved it.

Is that the branch that contains the connectionist, genetic algorithm,
complexity and chaos theory crowd?  Interesting stuff indeed, but I
didn't think it was that new.  When was Lorentz's paper?

>It does not make sense to measure the frequency response of the digital
>filter since you have H(Z) determined by the filter stricture. The
>|H(Z)| gives you the response in the clear analytical form.

only in a world where there are no such thing as software bugs,
incomplete specifications, human transcription errors and typos,
etc.  If for no other reason, I test my digital filters to make sure
I didn't drop a minus sign somewhere during the coding.

>Malcolm Haylock wrote:
>> To test the response I'm running the filters on white noise using a 1024
>> point buffer (which is what the program will use) then taking the DFT of
>> the output. I'm doing this 1000 times and averaging the result.
>>
>> The results look fine apart from the lowest frequency response. I've
>> tried using a Hamming window on the filter output before running the DFT
>> but there is still the problem.

You might want to make sure you are using a buffer much longer than
the impulse response in order to cancel out any startup conditions for
certain types of filter structures.


IMHO. YMMV.
-- 
Ron Nicholson   rhn AT nicholson DOT com   http://www.nicholson.com/rhn/ 
#include <canonical.disclaimer>        // only my own opinions, etc.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Rick Lyons - 2004-01-29 08:15:00

On Mon, 26 Jan 2004 11:45:55 -0800, "Bhaskar Thiagarajan"
<b...@deja.com> wrote:

  (snipped)
>
>Try this link - should take you to a archived thread in Google groups that
>talks about this topic
>(else try searching yourself in google groups for a thread with subject
>'filter freq response'.
>http://tinyurl.com/yud6z
>
>Cheers
>Bhaskar


Hi Bhaskar,

  I went further than that website's thread 
indicated.  8-10 guys here added "testing" ideas 
to the list that I created.  I've had it in the back 
of my mind that, when I get time, I'll rewrite that 
list, add the stuff from the other guys here and 
try to publish it.  (I wonder if a magazine will 
publish an article with 10 authors?)

Actually, Malcolm asks a good question.
I've always wondered if it's better to test a 
filter implementation by applying a unit sample 
impulse, and then FFTing the impulse response, or 
apply "white" noise and average multiple 
FFTs of the filter's output. 

Off the top of my head, I can't answer that simple 
question.

But I will say, I'd never use a filter in an 
application without testing the living heck 
out of the filter first.   Many filters 
"work" fine on paper, but not when implemented 
with finite binary word widths.

[-Rick-]

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Piergiorgio Sartor - 2004-01-29 08:30:00

Rick Lyons wrote:

> I've always wondered if it's better to test a 
> filter implementation by applying a unit sample 
> impulse, and then FFTing the impulse response, or 
> apply "white" noise and average multiple 
> FFTs of the filter's output. 

And what about a frequency sweep?

I was always thinking that such a signal should
give the "visual" frequency response in the time
domain, but I never got if it is meaningful...

> Off the top of my head, I can't answer that simple 
> question.

Well, I guess white noise is a must in non-linear
filters, since the impulse maybe does not reflect
the real filter performance.

bye,

-- 
   Piergiorgio Sartor
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Jerry Avins - 2004-01-29 11:02:00

Piergiorgio Sartor wrote:

   ...

>  the impulse maybe does not reflect
> the real filter performance.

How not?

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Problem measuring frequency response of filters - Piergiorgio Sartor - 2004-01-29 11:15:00

Jerry Avins wrote:

>>  the impulse maybe does not reflect
>> the real filter performance.
> 
> How not?

If the filter is non-linear, it means it cannot
neccessarily be decomposed, so the impulse response
can be misleading.

I think something like "abs(x)" is a simple example of this.

bye,

-- 
   Piergiorgio Sartor
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | 2 | next