Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Summary This assignment involves writing a computer program in the C programming language. It will read in a file of the values of a signal

Summary
This assignment involves writing a computer program in the C programming language. It will read in a file of the values of a signal and then calculate its Discrete Fourier Transform (DFT). The program will then attempt to 'smooth out' the signal using a moving average and then recalculate the transform.
Throughout the following questions, the 'length of the record' is denoted by N2. The data you have generated from the spreadsheet 'Assignmentdata' will consist of 5 columns of numbers. The first is the time value and the next four are four distinct signals. You should copy and paste this data into a plain text file to use as your input.
There are three parts to the assignment, be sure and answer the questions from all three parts.
Part 1
Two values will be used for your calculations here; N2=N1 and N2=2N1. Your program should carry out the following steps.
Read in the list of values in your input file, noting the number N1, the number of values in each signal (that is, each column of numbers) in your data. Let x1 to x4 be the four signals in your data. The following steps will be carried out for each of the four signals you have.
For the first signal in your data, x1[n], calculate the DFT of the signal x1[n] for N2=N1. The result of your calculation should be a list of values in a file. Explain in your program comments or elsewhere in your submission how your program handles the complex values of the transform widehat(x1)[k].
Repeat this process for length of record N2=2N1.
Part 2
A second signal y1 is constructed as the 5-point moving average of the signal x1. Using N1 as the length of the signal, this is defined as follows:
y1[0]=x1[0]
y1[1]=12(x1[0]+x1[1]),
y1[2]=13(x1[0]+x1[1]+x1[2]),
y1[2]=13(x1[0]+x1[1]+x1[2]),
y1[3]=14(x1[0]+x1[1]+x1[2]+x1[3]),
For all n>3 and (:x1[n+1]+x1[n+2]}(:x1[n+1]+x1[n+2]}
y1[N1-4]=14(x1[N1-4]+x1[N1-3]+x1[N1-2]+x1[N1-1])
y1[N1-3]=13(x1[N1-3]+x1[N1-2]+x1[N1-1])
y1[N1-2]=12(x1[N1-2]+x1[N1-1])
y1[N1-1]=x1[N1-1].
Your program should now carry out the following steps.
Generate the signal y1 from signal x1.
Calculate the DFT of the signal y1[n] for both values of the length of the record N2.
Part 3
You should now have data files with the signal x1, the smoothed signal y1 and the transforms of both signals for lengths of record N1 and 2N1.
Draw a plot of the real and complex components of transform widehat(x1)[k].
Draw plots of |(widehat(x1))[k]| and arg((widehat(x1))[k]), where |z| represents the modulus of the complex number z and arg(z) is the argument of z. So if r=|z| and A=arg(z) then z=rejA.
Explain the difference in your output when N2=2N1.
Draw a plot of the real and complex components of transform widehat(y1)[k].
Draw a plot of |(widehat(y1))[k]| and arg((widehat(y1))[k]).
Explain what the transform you have calculated is telling you about the signal x1. You should consider the meaning of the Fourier
Note: I have extensive Excel spreadsheet including signal data in the C programming language. However, due to its size, I am unable to upload it here. May I send it to you through an alternative way?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Find the intercepts of the graph of the line -8x + 5y = -40.

Answered: 1 week ago

Question

Explain the importance of HRM to all employees.

Answered: 1 week ago

Question

Discuss the relationship between a manager and an HR professional.

Answered: 1 week ago

Question

Outline demographic considerations.

Answered: 1 week ago