ΣSigmaStudio Ask AI Русский Log in

IIR filter  in DSP RUN-TIME LIBRARY

Processors & DSP ama Jun 7, 2011 00:00 3 replies Original on forum ↗
Subscribe
ama Question
Jun 7, 2011 00:00

Hello All,

I am preparing a report about iirdf1_fr16 (IIR filter form 1), and I have some questions.

Is the filter.h header file is enough to the library, or it needs a linking file?

The a_coeffs and b_coeffs how to obtain them, Should we use a software to calculate them first like Matlab

If anyone knows the answer, please reply.

Thank you in advance.

Regards,

AMA

ADIApproved Reply
Jun 7, 2011 00:00

Moved this question to Processors and DSP community. Please continue the discussion here.

Thanks,

AndyR

EngineerZone Community Manager

ADIApproved Reply
Jun 13, 2011 00:00

You don't need to do anything special to link a DSP library function with your application provided that:

(a) you #include the appropriate header file in your source program, and

(b) you are using a default or generated LDF file

(If you are using a customized LDF, then you should see how the default LDF ensures that an application links against the archive library libdsp.dlb.)

With regards to the filter coefficients, below an example on how Matlab could be used to generate the a_coeffs and b_coeffs (this requires the Mathwork's Filter Design Tool Box as well as the basic Matlab install):

% Chebyshev2 Low Pass filter, 3rd order, Fstop = 800Hz, stopband attenuation = 21dB
Fs=4000; % sample frequency (Hz)
fdescr = fdesign.lowpass('N,Fst,Ast',3,800,21,Fs);
fobj = design( fdescr, 'cheby2' );
% transform coefficients stored in SOS matrix to transfer function representation
[b_coeffs, a_coeffs] = sos2tf(fobj.sosMatrix);
% generate some input signal to verify the filter
F1=225; % frequency in pass band
F2=975; % frequency in stop band
F3=1e4/7; % frequency in stop band
t=0.997e-4:(1/Fs):((128/Fs)-0.997e-4);
sig = (sin(2*pi*t*F1) + cos(2*pi*t*F2) + sin(2*pi*t*F3))./9;
% apply filter
fresp = filter(b_coeffs, a_coeffs, sig);
plot(t,sig,'blue',t,fresp,'red');

Andreas

ama Reply
Jun 14, 2011 00:00

Hello Andreas,

than you very much, i used Matlab for my problem with my inputs and now i have the coefficients.

Regards,

ama