Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

DSP problem about implementation of a filter

Status
Not open for further replies.

snoopfan

Junior Member level 1
Joined
Sep 29, 2006
Messages
15
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,367
Can anyone please give me a solution of the following problem?

Thanks!

Implementation of a filter in C
-------------------------------------------

1.) Realize a transversal filter routine such that for every input an
output is created. The length of the filter is to be provided by
#define ... . When a new sample is input, no shift operation should
be carried out. Instead, a cyclically addressed buffer area should be
programmed where a "pointer" is moved to a next location before a
new input is stored. Correspondingly, the oldest value in the buffer
is lost.

The routine should obtain the filter coefficients when calling it the
first time (controlled by static variables). These coefficients should
be provided as columns in a file.

Call this routine with a main program to ensure that a chosen impulse
reponse is output, i.e., feed it with a single 1 followed by zeros and
store the resulting sequence in a file.

2.) Use the Gaussian generator to produce input samples. Determine the
average power before and after the filter. What is the relation
between input and output power. Explain!

---------------------- 2nd part

3.) Extend the filter routine to allow for recursive filters.

4.) Compute filter coefficients using Matlab filter tool "fdatool". Design
two filters of order 10:

a) FIR linear phase using a Hamming window
b) IIR Chebyshev type II filter

One of the right buttons "[b,o.]" allows to output the filter coefficients.
Use Edit - Convert to Single Section to obtain the coefficients of one single
filter. Otherwise it will be split into second-order components. Write
the coefficients into an ASCII file readable by your C-routine. For
the filter designs assume a sampling rate of 4.416 MHz and a "cut-off
frequency" (different meaning!) f_c/f_pass = 1.104 MHz. Plot the
amplitude and phase responses. What are the qualitative differences
between both designs?

5.) Run your filter routine in C and compute FFTs and square each
component. Average these components sufficiently to obtain a suitable
periodogram. Plot the periodograms for both filters and think about,
how the scaling should be, if the input voltages of your filter are
thought to be in Volts. The reference impedance is 50 Ohms. A standard
unit for a power-density spectrum is dBm/Hz. How do we obtain such a
scaling from the dimensionless periodogram.

The blocklength of the FFTs should be 512*2=1024.

For this example, we used the bandwidth of ADSL and two-times
oversampling. (The ADSL sampling frequency is 2.208 MHz.)

Please send the final program, plots of the filter responses
(amplitude/phase) and the periodograms (scaled!). Give short answers
for the given questions.

(Note that the "four1.c" FFT routine of Numerical Recipes had a bug
due to conversion from Fortran to C. The vector of time and DFT domain
variables needs to be defined a little longer in the calling routine -
at least by one as far as I remember.)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top