Home / Expert Answers / Computer Science / eecs-1011-lab-h-measure-music-with-your-arduino-v1-2023-part-2-filter-t-pa165

(Solved): EECS 1011 - Lab H: Measure Music with your Arduino (v1) 2023 Part 2: Filter t ...



EECS 1011 - Lab H: Measure Music with your Arduino (v1)
2023
Part 2: Filter the sound with a Moving average
Moving averagesIn fact, the effect can be really dramatic and make the signal more readable. For instance, when I applied a five-point movin???????

EECS 1011 - Lab H: Measure Music with your Arduino (v1) 2023 Part 2: Filter the sound with a "Moving average" Moving averages are a useful and easy way to remove noise in many signals. The concept of the moving (or rolling) average is explained here: https://en.wikipedia.org/wiki/Moving_average for max_samples-filter_size) ) avg_sound_data mean sound_data end Figure 6 An example of a moving average filter, where the maximum number of sound measurements has been determined (max_samples) ahead of time and the filter_size says how many samples I want to create an average over (e.g. 3 to 10). The idea behind the moving average filter is that you 1. Capture a few data points and put it in a set 2. Take the average of those data points 3. Graph the average of those data max samples o how many times do we check the sound sensor? points 4. Capture one more data point 5. Remove the oldest data point in the previous set 6. Shift all the old data points back, so the youngest data point is now the second youngest and the second oldest data point is now the oldest in the set. 7. Place the newest data point in Figure 7 Use this code to capture the sound data. Then add a moving averag filter to it. the position previously held by the youngest data point (now the second-youngest) 8. Take the average of this updated data set 9. Graph the new average beside the old average. 10. "Rinse and repeat." Your data set can be any size you wish. I suggest having a five point moving average that is, there are five data points that make up your average value. When you update your data set, the fourth member of the data set gets placed in Position 5 and the member of the data set gets placed in Position 2. Then the newest data point goes into Position 1: In fact, the effect can be really dramatic and make the signal more readable. For instance, when I applied a five-point moving average filter to the Whitney Houston and Phil Collins audio, this is what happened: Figure 9 The Whitney Houston track, unfiltered (left) and filtered (right). https://ww.youtube.com/watch?v=ardglrgMVVQ Figure 10The Phil Collins track, unfiltered (left) and filtered (right). https://wwwyoutube,com/watch?v=0l3iufiywU The amplitude (height) of the signals decreased, but it became much easier to visually identify when the sound intensity increased in a meaningful, sustained way. Write a MATLAB script that implements a moving average filter on the piano track that I provided to you. Demonstrate to the TA that you can capture the four notes of the recorded piano using the script here but, this time, with the five-point moving average filter. Full marks if you show at least two peaks in your graph.


We have an Answer from Expert

View Expert Answer

Expert Answer


To add a moving average filter to the sound data, you can use the code provided in Figure 6 and modify it to fit your specific application. Here is an
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe