Reply by Roman Rumian●September 16, 20052005-09-16
Hi Jon,
Jon Harris napisa�(a):
> Are you implementing the filter as a single 8th order filter?
No, as a cascade of 4 second order sections.
Here is the code:
ori #$08,mr ;set scaling mode
do #nchan,bcend ;FOR each out channel
move y:(r5),y1 ;get delayed channel sample
do #butsec,coend ;do each section
move x:(r1)+,x0 y:(r4)+,y0 ;get x(n-2), B2
mpy x0,y0,a x:(r1)-,x1 y:(r4)+,y0 ;a=B2*x(n-2) get B1,x(n-1)
mac x1,y0,a x1,x:(r1)+n1 y:(r4)+,y0 ;a=a+B1*x(n-1) save x(n-2)=x(n-1),
get B0
mpy y1,y0,b x:(r1)+,x0 y:(r4)+,y0 ;b=B0*x(n) get y(n-2),A2
mac -x0,y0,a x:(r1)-,x0 y:(r4)+,y0 ;a=a-y(n-2)*A2 get y(n-1), A1
mac -x0,y0,a x0,x:(r1)- ;a=a-y(n-1)*A1 save y(n-2)=y(n-1)
; asl #1,a,a
add b,a b,x:(r1)+n1 ;save x(n-1)=x(n)*B0
move a,y1 a,x:(r1)+ ;save y(n-1)=y(n)->x(n)=y1 in next SOS
coend
move a,y:(r5)+ ;save filtered channel sample
bcend
;
> If so, the easy
> solution is to break it into 4 second order sections.
> For 200 Hz at Fs=48kHz, I
> think it should be fine with 24-bits as long as you are only doing second order
> sections. Al's suggestion is also a good one--filter form often makes a big
> difference.
At 200 Hz noise dissappear, but as I need it in xover filter pair, have
to improve 20-200 Hz band.
Thank you
Roman Rumian
Reply by Roman Rumian●September 16, 20052005-09-16
Hi Jon,
Jon Harris napisa�(a):
> Are you implementing the filter as a single 8th order filter?
No, as a cascade of 4 second order sections.
Here is the code:
ori #$08,mr ;set scaling mode
do #nchan,bcend ;FOR each out channel
move y:(r5),y1 ;get delayed channel sample
do #butsec,coend ;do each section
move x:(r1)+,x0 y:(r4)+,y0 ;get x(n-2), B2
mpy x0,y0,a x:(r1)-,x1 y:(r4)+,y0 ;A=B2*x(n-2) get B1,x(n-1)
mac x1,y0,a x1,x:(r1)+n1 y:(r4)+,y0 ;A=A+B1*x(n-1) save x(n-2)=x(n-1),
get B0
mpy y1,y0,b x:(r1)+,x0 y:(r4)+,y0 ;B=B0*x(n) get y(n-2),A2
mac -x0,y0,a x:(r1)-,x0 y:(r4)+,y0 ;A=A-y(n-2)*A2 get y(n-1), A1
mac -x0,y0,a x0,x:(r1)- ;A=A-y(n-1)*A1 save y(n-2)=y(n-1)
add b,a b,x:(r1)+n1 ;save x(n-1)=x(n)*B0
move a,y1 a,x:(r1)+ ;save y(n-1)=y(n)->x(n)=y1 in next SOS
coend
move a,y:(r5)+ ;save filtered channel sample
bcend
;
> If so, the easy
> solution is to break it into 4 second order sections.
> For 200 Hz at Fs=48kHz, I
> think it should be fine with 24-bits as long as you are only doing second order
> sections. Al's suggestion is also a good one--filter form often makes a big
> difference.
At 200 Hz noise dissappear, but as I need it in xover filter pair, have
to improve 20-200 Hz band.
Thank you
Roman Rumian
Reply by Jon Harris●September 15, 20052005-09-15
Are you implementing the filter as a single 8th order filter? If so, the easy
solution is to break it into 4 second order sections. For 200 Hz at Fs=48kHz, I
think it should be fine with 24-bits as long as you are only doing second order
sections. Al's suggestion is also a good one--filter form often makes a big
difference.
--
Jon Harris
SPAM blocker in place:
Remove 99 (but leave 7) to reply
"Roman Rumian" <usun_torumian@agh.edu.pl> wrote in message
news:dg96j9$nhk$1@news.agh.edu.pl...
> Hello Jon,
>
> Jon Harris napisa�(a):
>> I don't know if this is the best way or not, but the problem I've had with
>> limited-precision IIR filters is with distortion being generated with very
>> low frequency inputs. (...)
>
> I have this problem. IIR Butterworth 8 order highpass filter at frequencies
> below 200 Hz (Fs=48000/s) is unstable - it generates a 'brumm' noice.
>
> I use DSP56300 processor (24-bit precision), so what to do ?
> Redesign filter, or use double precision variables ?
>
> Kind regards
>
> Roman Rumian
Reply by Roman Rumian●September 14, 20052005-09-14
Al Clark napisa�(a):
(...)
> IIR filters often have problems at low frequencies (as compared to the
> sample rate). I would use a Direct Form I (chances are you are using DF II
> cascades). This topic has been discussed in detail by Rhonda Wilson and
> others in the AES journal. You can get her paper from www.aes.org
>
> The problem can also be addressed by using double precision on the 56K or
> using a higher precision DSP such as a SHARC (32 bits vs 24 bits).
Thank you Al ! :-)
Roman Rumian
Reply by Al Clark●September 14, 20052005-09-14
Roman Rumian <usun_torumian@agh.edu.pl> wrote in
news:dg96j9$nhk$1@news.agh.edu.pl:
> Hello Jon,
>
> Jon Harris napisa�(a):
>> I don't know if this is the best way or not, but the problem I've had
>> with limited-precision IIR filters is with distortion being generated
>> with very low frequency inputs. (...)
>
> I have this problem. IIR Butterworth 8 order highpass filter at
> frequencies below 200 Hz (Fs=48000/s) is unstable - it generates a
> 'brumm' noice.
>
> I use DSP56300 processor (24-bit precision), so what to do ?
> Redesign filter, or use double precision variables ?
>
> Kind regards
>
> Roman Rumian
>
IIR filters often have problems at low frequencies (as compared to the
sample rate). I would use a Direct Form I (chances are you are using DF II
cascades). This topic has been discussed in detail by Rhonda Wilson and
others in the AES journal. You can get her paper from www.aes.org
The problem can also be addressed by using double precision on the 56K or
using a higher precision DSP such as a SHARC (32 bits vs 24 bits).
--
Al Clark
Danville Signal Processing, Inc.
--------------------------------------------------------------------
Purveyors of Fine DSP Hardware and other Cool Stuff
Available at http://www.danvillesignal.com
Reply by Roman Rumian●September 14, 20052005-09-14
Hello Jon,
Jon Harris napisa�(a):
> I don't know if this is the best way or not, but the problem I've had with
> limited-precision IIR filters is with distortion being generated with very low
> frequency inputs. (...)
I have this problem. IIR Butterworth 8 order highpass filter at
frequencies below 200 Hz (Fs=48000/s) is unstable - it generates a
'brumm' noice.
I use DSP56300 processor (24-bit precision), so what to do ?
Redesign filter, or use double precision variables ?
Kind regards
Roman Rumian
Reply by Jon Harris●September 9, 20052005-09-09
I don't know if this is the best way or not, but the problem I've had with
limited-precision IIR filters is with distortion being generated with very low
frequency inputs. Put a large sinusoidal input at the lowest frequency you
expect into your filter. If your filter is variable, pick the worst-case
coefficients (usually the lowest frequency and/or highest Q). Then grab the
output, filter out the input frequency with a very deep and narrow notch
(implemented with the highest precision available) and look at the RMS level of
whatever is left over. This is the distortion and/or noise generated by your
filter. Compare to your double-precision implementation.
--
Jon Harris
SPAM blocker in place:
Remove 99 (but leave 7) to reply
"m2francis" <m2francis@aol.com> wrote in message
news:hcmdnf3KIYdqWr3eRVn-hg@giganews.com...
>I have implemented a fixed point IIR filter and now comparing it against
> double precision implementation in simulink.
>
> I dont want to just select 32 bits. I just want to have enough precision
> bits so thats its not unstable. What parameter do I use in order to
> measure the quality of the fixed point implemention? Is it the RMS on the
> difference between the two implementations?
>
> Mike
Reply by m2francis●September 8, 20052005-09-08
I have implemented a fixed point IIR filter and now comparing it against
double precision implementation in simulink.
I dont want to just select 32 bits. I just want to have enough precision
bits so thats its not unstable. What parameter do I use in order to
measure the quality of the fixed point implemention? Is it the RMS on the
difference between the two implementations?
Mike
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com