Question: Generate a random input sequence x[n] of N+1 double precision real numbers in the range [0...1]. Your program should output the value y[N]. Implement a
Generate a random input sequence x[n] of N+1 double precision real numbers in the range [0...1]. Your program should output the value y[N].
Implement a recursive function to compute s[n]:
double s(int n);
Declare x[n] as a global array of N+1 double precision values:
#define N 105
double x[N+1];
With x[n] global, function s(int n) can reference x[n].
Use a counter to track the number of calls to function s(int n). Report the total number of function calls made.
The code is to be written in C language Consider the following two-stage digital filter s[n] = x[n] + 2cos(w.)s[n 1] s[n 2] y[N] = s[N] e Wo s[N 1] Om- where 2nk k = N, wo = N n 0, 1, .., N !! x[n] is a sequence of N+1 input values, fi is a target frequency, fs is a sampling rate, and y[n] is an output sequence. In this assignment, develop a program to compute y[n] given x[n], where s[n] is computed recursively. Assume s[-1] and s[-2] = 0.0. Define N = 40, fs = 8 kHz and fi to be any one of the frequencies 697, 770, 852, 941, 1209, 1336, 1477, or 1633 Hz, your choice.
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Please find the code below for the required task in C Language ... View full answer
Get step-by-step solutions from verified subject matter experts
