EE 285 Lab 7: Noise Filtering
Purpose
Deliverables
what effect the window size (N) had on the output.
This week you will be attempting to remove some imperfections from a sound file. We have
provided two sound files containing the same speech but marred by two different types of noise:
white and pink. It is not relevant for this class to know the difference between the two. Your
the program should meet the following requirements:
is.
Store N magnitudes at a time in a history array (e.g. pushing the new values into index 0
and keeping the oldest at index N-1)
When scanning in the initial .dat file, you will need to scan in the metadata lines at the beginning
before you start scanning in the floating-point times and magnitudes. Because using %s in scanf
stops at each whitespace, we want another function that can scan an entire line. C provides this
with the fgets function. fgets takes in a string, the maximum length of the string, and where you
want to get the string from. In our case, to read in a single line of metadata, we can write this
code to store up to 100 characters (or up to and including the newline) inside of myString.
fgets(myString, 100, stdin);
Once your metadata has been dealt with, you can start scanning in the data. To compute a
moving average, you’ll need to place the new values in an array and push the old values out.
Here is a decent animation of how this process looks when done on a line graph. Notice that it
doesn’t start averaging until there are N data points inside of the window (it doesn’t average
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
Get Free Quote!
263 Experts Online