Not 0 dB? What is it?
Are you applying a window?
What's the FFT size?
How is your FFT calibrated to dB?
Dirk
I have done an impulse response of an IIR filter. The impulse response of
the filter does not return to zero but stops at a level close to zero (I
think it’s because limitations in fraction bits). The filter is implemented
in fixed point arithmetic’s.
I believe you have diagnosed the problem correctly.
And when I make an FFT of the impulse response de 0 Hz gain is not 0 dB as I
would like it to be.
That's not surprising.
But when I run a step response I get almost perfect 0 Hz gain of 0 dB.
That is also not surprising.
So the problem is that the FFT of the impulse response says the gain is not
0 dB at 0 Hz but the step response says the gain is 0 dB at 0 Hz?
No. The problem is that you are using a method of analyzing linear
Marko wrote:
I have done an impulse response of an IIR filter. The impulse response
of
the filter does not return to zero but stops at a level close to zero (I
think it’s because limitations in fraction bits). The filter is
implemented
in fixed point arithmetic’s.
I believe you have diagnosed the problem correctly.
And when I make an FFT of the impulse response de 0 Hz gain is not 0 dB
as I
would like it to be.
That's not surprising.
But when I run a step response I get almost perfect 0 Hz gain of 0 dB.
That is also not surprising.
So the problem is that the FFT of the impulse response says the gain is
not
0 dB at 0 Hz but the step response says the gain is 0 dB at 0 Hz?
No. The problem is that you are using a method of analyzing linear
systems (the FFT) on a nonlinear system (a filter with quantization),
and expecting the results to be consistent with linear system theory.
If your filter settles out close enough to your DC value to be
acceptable then call it good, and don't sweat the impulse response
issues. If it doesn't then you need to use higher precision math or you
need to juggle your filter algorithm around to better use the precision
you have. You didn't say if it was 1st-order, 2nd or higher, or how you
are implementing your algorithm.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Marko wrote:
I have done an impulse response of an IIR filter. The impulse response of
the filter does not return to zero but stops at a level close to zero (I
think it's because limitations in fraction bits). The filter is implemented
in fixed point arithmetic's.
The problem is that you are using a method of analyzing linear
systems (the FFT) on a nonlinear system (a filter with quantization),
and expecting the results to be consistent with linear system theory.
If your filter settles out close enough to your DC value to be
acceptable then call it good, and don't sweat the impulse response
issues.
I’m implementing the filter in an Texas Instruments DSP in Q-math (fixed
point library routines).
I’m running/simulating the filter as second order sections in Simulink using
C28x IQmath Library. The filter coefficients are calculated in FDAtool.
The filter is an 8th order Butterworth filter. But I hade a similar result
with a 4th order Butterworth as well at DC (0 Hz).
But now I know what error I did. Looking at a nonlinear system thinking it
was linear.
How should I check the implemented filter transfer function? I should check
DC-gain with a step function you said, but what about the rest? Should I try
the filter with different sinus waves and check the output amplitudes?
Thanks :-)
"Tim Wescott" <tim@seemywebsite.com> skrev i meddelandet
news:aZudnccwIfaYnDbeRVn-uw@web-ster.com...
Marko wrote:
I have done an impulse response of an IIR filter. The impulse response
of
the filter does not return to zero but stops at a level close to zero (I
think it’s because limitations in fraction bits). The filter is
implemented
in fixed point arithmetic’s.
I believe you have diagnosed the problem correctly.
And when I make an FFT of the impulse response de 0 Hz gain is not 0 dB
as I
would like it to be.
That's not surprising.
But when I run a step response I get almost perfect 0 Hz gain of 0 dB.
That is also not surprising.
So the problem is that the FFT of the impulse response says the gain is
not
0 dB at 0 Hz but the step response says the gain is 0 dB at 0 Hz?
No. The problem is that you are using a method of analyzing linear
systems (the FFT) on a nonlinear system (a filter with quantization),
and expecting the results to be consistent with linear system theory.
If your filter settles out close enough to your DC value to be
acceptable then call it good, and don't sweat the impulse response
issues. If it doesn't then you need to use higher precision math or you
need to juggle your filter algorithm around to better use the precision
you have. You didn't say if it was 1st-order, 2nd or higher, or how you
are implementing your algorithm.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
If you're mostly interested in the transfer function then doing it with
Tim Wescott wrote:
Marko wrote:
I have done an impulse response of an IIR filter. The impulse response of
the filter does not return to zero but stops at a level close to zero (I
think it's because limitations in fraction bits). The filter is implemented
in fixed point arithmetic's.
The problem is that you are using a method of analyzing linear
systems (the FFT) on a nonlinear system (a filter with quantization),
and expecting the results to be consistent with linear system theory.
If your filter settles out close enough to your DC value to be
acceptable then call it good, and don't sweat the impulse response
issues.
Tim, i think that guy's problem is simply a case of limit cycling on
the quantization. it can be dealt with by "first-order noise shaping
with a zero at z=1" or simply called "fraction saving". that DC
blocking filter trick at DSPguru.com deals with this issue.
r b-j
Closely related to http://www.wescottdesign.com/articles/sigmadelta.html.
robert bristow-johnson wrote:
Tim Wescott wrote:
Marko wrote:
I have done an impulse response of an IIR filter. The impulse response
of
the filter does not return to zero but stops at a level close to zero (I
think it's because limitations in fraction bits). The filter is
implemented
in fixed point arithmetic's.
The problem is that you are using a method of analyzing linear
systems (the FFT) on a nonlinear system (a filter with quantization),
and expecting the results to be consistent with linear system theory.
If your filter settles out close enough to your DC value to be
acceptable then call it good, and don't sweat the impulse response
issues.
Tim, i think that guy's problem is simply a case of limit cycling on
the quantization. it can be dealt with by "first-order noise shaping
with a zero at z=1" or simply called "fraction saving". that DC
blocking filter trick at DSPguru.com deals with this issue.
r b-j
Closely related to http://www.wescottdesign.com/articles/sigmadelta.html.
"Tim Wescott" <tim@seemywebsite.com> wrote in message
news:yfmdnXCPfaXDzDbenZ2dnUVZ_tmdnZ2d@web-ster.com...
robert bristow-johnson wrote:
Tim Wescott wrote:
Marko wrote:
I have done an impulse response of an IIR filter. The impulse response
of
the filter does not return to zero but stops at a level close to zero (I
think it's because limitations in fraction bits). The filter is
implemented
in fixed point arithmetic's.
The problem is that you are using a method of analyzing linear
systems (the FFT) on a nonlinear system (a filter with quantization),
and expecting the results to be consistent with linear system theory.
If your filter settles out close enough to your DC value to be
acceptable then call it good, and don't sweat the impulse response
issues.
Tim, i think that guy's problem is simply a case of limit cycling on
the quantization. it can be dealt with by "first-order noise shaping
with a zero at z=1" or simply called "fraction saving". that DC
blocking filter trick at DSPguru.com deals with this issue.
r b-j
Closely related to http://www.wescottdesign.com/articles/sigmadelta.html.
I'm surprised that no one has mentioned the fact that you can't really do an
FFT of the impulse response of an IIR filter. The response at DC is the
integral of the impulse response. But, in this case it's been truncated.
This means that some part of the integral is missing. It's supposed to sum
to zero but it doesn't. Are 48000 samples a little or a lot in terms of
this particular impulse response and the sampling rate?
I'm not suggesting that this is the likely cause of the problem seen. Just
that it shouldn't be neglected out of hand.
I'm sure someone will point out why this isn't a very important
consideration in this case and THAT will answer the question!
Fred
Good point. Assuming the response has mostly died off taking the FFT
Fred Marshall wrote:
"Tim Wescott" <tim@seemywebsite.com> wrote in message
news:yfmdnXCPfaXDzDbenZ2dnUVZ_tmdnZ2d@web-ster.com...
robert bristow-johnson wrote:
Tim Wescott wrote:
Marko wrote:
I have done an impulse response of an IIR filter. The impulse
response
of
the filter does not return to zero but stops at a level close to zero
(I
think it's because limitations in fraction bits). The filter is
implemented
in fixed point arithmetic's.
The problem is that you are using a method of analyzing linear
systems (the FFT) on a nonlinear system (a filter with quantization),
and expecting the results to be consistent with linear system theory.
If your filter settles out close enough to your DC value to be
acceptable then call it good, and don't sweat the impulse response
issues.
Tim, i think that guy's problem is simply a case of limit cycling on
the quantization. it can be dealt with by "first-order noise shaping
with a zero at z=1" or simply called "fraction saving". that DC
blocking filter trick at DSPguru.com deals with this issue.
r b-j
Closely related to
http://www.wescottdesign.com/articles/sigmadelta.html.
I'm surprised that no one has mentioned the fact that you can't really
do an
FFT of the impulse response of an IIR filter. The response at DC is the
integral of the impulse response. But, in this case it's been
truncated.
This means that some part of the integral is missing. It's supposed to
sum
to zero but it doesn't. Are 48000 samples a little or a lot in terms of
this particular impulse response and the sampling rate?
I'm not suggesting that this is the likely cause of the problem seen.
Just
that it shouldn't be neglected out of hand.
I'm sure someone will point out why this isn't a very important
consideration in this case and THAT will answer the question!
Fred
Good point. Assuming the response has mostly died off taking the FFT
should be valid, though.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Users browsing this forum: No registered users and 0 guests