Consider the following two-stage digital filter where s[n]=x[n]+2 cos(a)s [n-1]-s[n-2] y[N] = s[N]-es [N-1] 2 N...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following two-stage digital filter where s[n]=x[n]+2 cos(a)s [n-1]-s[n-2] y[N] = s[N]-es [N-1] 2πκ N x[n] is a sequence of N+1 input values, f; is a target frequency, fs is a sampling rate, and y[n] is an output sequence. k=Ni fs @o = " n = 0, 1,..., N 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 f; to be any one of the frequencies 697, 770, 852, 941, 1209, 1336, 1477, or 1633 Hz, your choice. 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. Consider the following two-stage digital filter where s[n]=x[n]+2 cos(a)s [n-1]-s[n-2] y[N] = s[N]-es [N-1] 2πκ N x[n] is a sequence of N+1 input values, f; is a target frequency, fs is a sampling rate, and y[n] is an output sequence. k=Ni fs @o = " n = 0, 1,..., N 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 f; to be any one of the frequencies 697, 770, 852, 941, 1209, 1336, 1477, or 1633 Hz, your choice. 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.
Expert Answer:
Answer rating: 100% (QA)
Please find the code below for the required task in C Language You may chang... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Consider the following two lottery type games: Game 1: You pick one number between 1 and 50. After you have made your choice, a number between 1 and 50 is selected at random. If the selected number...
-
Consider the following two samples: Sample 1: 10, 9, 8, 7, 8, 6, 10, 6 Sample 2: 10, 6, 10, 6, 8, 10, 8, 6 (a) Calculate the sample range for both samples. Would you conclude that both samples...
-
Consider the following two mutually exclusive projects: Whichever project you choose, if any, you require a 15 percent return on your investment. (a) If you apply the payback criterion, which...
-
If a company is very diversified, (a) it makes it easier to classify the company by industry. (b) it would not be necessary to provide any segmented information. (c) it can limit the usefulness of...
-
The line y = ax + b s called an oblique asymptote to the graph of y = f(x) if either or Find the oblique asymptote for F(x) = 2x4 + 3x3 - 2x - 4 / x3 - 1 lim LCr) (ax+ b)l o limo [f(x)-(ax + b)] = 0.
-
Consider three scenarios for a one-dimensional elastic collision in which a bullet is fired at a stationary target. For each scenario, determine the final velocities of both the bullet, v 1f , and...
-
Mr. Tam is the front man for the Asian American dance-rock band The Slants. Mr. Tam named his band The Slants to reclaim and take ownership of Asian stereotypes. The band draws inspiration for its...
-
The State Government administers a special revenue fund, the Fish and Game Fund. By legislation, revenue in this fund can be used only for the purpose of protection, propagation, and restoration of...
-
6) You must show the working to earn marks The height y (in feet) of a punted football is given by 20 9 y= + -x+1.6 2025 5 where x is the horizontal distance (in feet) from the point at which the...
-
Exercise 14-17 (Algorithmic) (LO. 1, 4) Prance, Inc., earned pretax book net income of $1,925,000 in 2020. Prance acquired a depreciable asset in 2020, and first-year tax depreciation exceeded book...
-
How did Dr. Falwelland his work with Moral Majority influence how Americans thinkabout religion and government involvement? Dr. Falwell encouragedProtestants to vote differently than Catholics. Dr....
-
Lajos borrows $5,000 on April 7 at prime + 1%. The prime rate was initially 3%. It increased to 3.25% on May 23 and to 3.50% on July 13. What was the amount required to repay the loan on August 2?
-
Calculate the rate of return on a price-weighted index of the three stocks below. Stock Price Today MSFT 40 AAPL 70 770 Price Next Month 30 30 Shares 200 30 500 AMZN 10 30 600
-
d) Find the size of the delay of the code segment below (in microconds) assuming 100 MHz internal clock frequency: Note that nop is a icycle command that just wastes the processor's time DELAY movlw...
-
For his business, Nicholas leased equipment valued at $25,000. The terms of the lease required payments of $1850 every month. If the first payment is due eighteen months after the lease was signed...
-
A genetically engineered strain of Escherichia coli (E. coli) is used to synthesize human insulin for people suffering from type I diabetes mellitus. In the following simplified reaction scheme,...
-
For any positive integer x, let xR be the integer whose binary representation is the reverse of the binary representation of x. (Assume no leading 0s in the binary representation of x.) Define the...
-
Consider the following CFG G: S SS | T T aT b | ab Describe L(G) and show that G is ambiguous. Give an unambiguous grammar H where L(H) = L(G) and sketch a proof that H is unambiguous.
-
Let = {0,1}. Show that the problem of determining whether a CFG generates some string in 1 is decidable. In other words, show that {G| G is a CFG over {0,1} and 1 * L(G) } is a decidable language.
-
Gross profit is (A) Excess of sales over cost of goods sold (B) Sales less purchases (C) Cost of goods sold + opening inventory (D) Net profit less expenses of the period
-
To find the value of closing inventory at the end of a period we (A) Do this by physically counting the inventory (i.e. stocktaking) (B) Look in the inventory account (C) Deduct opening inventory...
-
Net profit is calculated in the (A) Trading account (B) Profit and loss account (C) Trial balance (D) Statement of financial position
Study smarter with the SolutionInn App