Question: y ( n ) = [ x ( n ) + x ( n 1 ) + + x ( n N ) ] /

y(n)=[x(n)+ x(n1)++ x(nN)]/N where N is the length of the filter, x(n) is the noisy
data and y(n) is the clean data, n is the current time point. The data to be used is provided as xdata.txt on Canvas Files menu. The first column of the xdata.txt file is the clean data, while the second column is the noisy data. You will filter the second column using the filter equation given above.
- Create a C program to do moving average filtering using the data provided. Call your
program MovingAve.c. This code should result in filtered data, call it filtered.txt.
- Then using the clean data, noisy data and filtered data create a figure for each also create figure that plots all the clean, filtered and noisy data together (use different colors to distinguish). You can either use a plotting software like Gnuplot open source plotting software OR use MATLAB to plot the data you have
Sinpit of xdata.txt:
1.000000000.98526057
0.991444860.92002067
0.965925830.68424273
0.923879530.90203224
0.866025400.41819097
0.793353340.97227762
0.707106780.63274799
0.608761430.86928190
0.500000000.54609943
0.382683430.51006215
0.25881905-0.04556778
0.13052619-0.02197676
0.00000000-0.58515007
-0.13052619-0.13770544
-0.25881905-0.15610787
-0.38268343-0.41134279
-0.50000000-0.89270816
-0.60876143-0.39635066
-0.70710678-0.68396723
-0.79335334-1.12138686
-0.86602540-0.98894666
-0.92387953-1.02472215
-0.96592583-0.88303537
-0.99144486-1.03759573
-1.00000000-0.72734134
-0.99144486-0.67684585
-0.96592583-1.14940179
-0.92387953-1.15248405
-0.86602540-1.40679000
-0.79335334-0.14515031

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!