• 100% Satisfaction Guarantee
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
3546829
Scott is online now

I need a program, c++, ntroduction: An FIR (Finite Impulse

Customer Question

i need a program
JA: What programs and versions are you using?
Customer: c++
JA: What is your ideal outcome? How can we solve this for you?
Customer: ntroduction:
An FIR (Finite Impulse Response) filter can be represented by
min ( −1, )
[ ] = ∑ [ − ]h[ ] =0
(1)
where is the number of coefficients, h[ ] is the impulse response of the filter, [ − ] is the input of the filter delayed clock cycles, [ ] is the output of the filter, and [ ] = 0 for < 0.
A discrete filter accepts a sequence of data (input), one at a time, and produces a new sequence of data (output), one at a time. In the above equation, is the time index, = 0, 1, 2, .... The filter behavior is explained below.
At = 0, the filter gets only one input which is [0], so the filter uses [0] to generate the output [0] at time moment of = 0. At = 1, the filter has two inputs available which are [0], [1], so it will use these two values to generate the output [1]. When the number of input data grows higher than 35, the filter only uses the latest 35 inputs to compute the output. In other words, equation (1) can be split into the following two equations:
and
[ ] = ∑ [ − ]h[ ] , < (2) =0
−1
[ ] = ∑ [ − ]h[ ], ≥ (3) =0
where = 35 which is the order number for the filter we use below.
From equation (2), we can calculate [ ] for < 35 as follows: [0] = h[0]
[1] = [1]h[0] + [0]h[1]
[2] = [2]h[0] + [1]h[1] + [0]h[2] ...
ECE 206/L
1
From equation (3), we can calculate [ ] for ≥ 35 as follows:
[35] = [35]h[0] + [34]h[1] + ⋯ [3]h[32] + [2]h[33] + [1]h[34] [36] = [36]h[0] + [35]h[1] + ⋯ [4]h[32] + [3]h[33] + [2]h[34] [37] = [37]h[0] + [36]h[1] + ⋯ [5]h[32] + [4]h[33] + [3]h[34]

A given optimal equiripple FIR (Finite Impulse Response) filter has the following specification: Sample rate: 10 kHz (0.0001 sec / sample);
Passband: 0 – 2.5 kHz (lowpass), 0.5 dB maximum ripple; Stopband: 3.0 – 5 kHz, 50dB minimum attenuation.
Using the Parks-Mcclellan program, we obtain the following impulse response values (scaled up by 215; ie. to get actual value, divide by 215), with = 35.
h(0) = h(34) = 361.922 h(1) = h(33) = 589.000 h(2) = h(32) = 52.556 h(3) = h(31) = -538.095 h(4) = h(30) = -58.657 h(5) = h(29) = 499.472 h(6) = h(28) = -251.531 h(7) = h(27) = -785.168 h(8) = h(26) = 381.999
h(9) = h(25) = 812.822 h(10) = h(24) = -934.419 h(11) = h(23) = -1082.725 h(12) = h(22) = 1547.666 h(13) = h(21) = 1083.109 h(14) = h(20) = -3229.928 h(15) = h(19) = -1275.738 h(16) = h(18) = 10268.660 h(17) = h(17) = 17571.900
Courtesy: Dale Clover & John Deller, Digital Signal Processing and Microcontroller, Motorola University, Prentice-Hall, 1999.
Write a C++ program to do steps 1 to 4 and use Excel to do step 5:
1. Create three arrays [600], h[35], and [600].
2. Fill the array with the 600 sample values of ( ) = 100 sin(4000 ) for 0 ≤ < 0.06 with rate of Δ = 0.0001 per sample. Note that the frequency for the sinewave is 2 KHz.
3. Compute [ ] for 0 ≤ < 0.06.
4. Store the 600 sample values of [ ] in file filex and store the 600 sample values of [ ] in file filey.
5. Plot [ ] and [ ] versus on the same graph using Excel. Compare and comment on the
amplitude of the two sinewaves [ ] and [ ].
ECE 206/L
2
Program Outcomes and Discussions:
1. Repeat steps 1 to 5 for ( ) = 100 sin(4000 ), frequency 2 kHz.
2. Repeat steps 1 to 5 for ( ) = 100 sin(6000 ), frequency 3 kHz.
3. Repeat steps 1 to 5 for ( ) = 100 sin(8000 ), frequency 4 kHz.
4. Compare the amplitudes of the two sinewaves [ ] and [ ] for frequencies 2 kHz, 3 kHz, and 4 kHz. Categorize the filter either as low pass filter, high pass filter, or band-pass filter.
JA: Anything else you want the programmer to know before I connect you?
Customer: no
Submitted: 11 days ago.
Category: Homework
Expert:  swmcdonnell replied 11 days ago.

Hi there, my name is***** do you need this?

Customer: replied 11 days ago.
by tonight
Customer: replied 11 days ago.
i dont really have a program for it
Customer: replied 11 days ago.
if you connect to my device, there is nothing to fix
Expert:  swmcdonnell replied 11 days ago.

I don't want to connect to your device.

Expert:  swmcdonnell replied 11 days ago.

Sorry, I don't think I can finish all this by tonight. I'll opt out and you can see if someone else will help you.