From: natanel on
I am trying to create fix point butter filter to get NUM and DEN for my MCU filtering

I know I should do it like that
Fs=1000; % sample frequency
Fc=45; %cutoff frequency
[B,A]=butter(7,Fc/(Fs/2));
hd=dfilt.df2(B,A);

%then set hd
set(hd,'Arithmetic','fixed');

from there I am quit confised which other set I should do

all the output/input data and coeff are Q1.15 signed
mean 16 bit numberes with 15 bit Frac

any help?
thanks
From: Wayne King on
"natanel " <jn_eizenberg(a)hotmail.com> wrote in message <hvlsj6$h5v$1(a)fred.mathworks.com>...
> I am trying to create fix point butter filter to get NUM and DEN for my MCU filtering
>
> I know I should do it like that
> Fs=1000; % sample frequency
> Fc=45; %cutoff frequency
> [B,A]=butter(7,Fc/(Fs/2));
> hd=dfilt.df2(B,A);
>
> %then set hd
> set(hd,'Arithmetic','fixed');
>
> from there I am quit confised which other set I should do
>
> all the output/input data and coeff are Q1.15 signed
> mean 16 bit numberes with 15 bit Frac
>
> any help?
> thanks

Hi Natanel,
That depends on the reason why you are designing a fixed-point filter. Presumably you are designing the filter with a particular embedded system in mind? What are the wordlength constraints of that system? etc.

Wayne
From: natanel on
Hi

it is for atmel dsp32
and used with dsp16_t
mean all wordlength are 16 bit
input, output, coeff

when it is set to Q A.B signed
A=1 bit
B=15 bit

thanks