To implement 3 point moving average filter using convolution in matlab on wav file i used following code but the code is working but there is problem in convolution .here is the m file

7 views (last 30 days)
problem in convolution plot help please

Accepted Answer

Walter Roberson
Walter Roberson on 25 Jul 2015
You never apply the filter or the convolution to the sound array. You read in the sound array and you play the sound, but you never filter it.
You convolve [1 2 3] with the kernel 1/3*[1 1 1], and you use stem() to plot the result against [1 2 3], but that has nothing to do with the sound.
You filter [1 2 3] with 1/3*[1 1 1] but you never use the result.
You fft([1 2 3]) and you stem() the values [1 2 3] at the positions returned as fft() values. I would have expected you would stem using [1 2 3] as the positions (first argument) and the fft() as the values (second argument), but that is not what you did.
Please note that the result of fft() is usually complex. For plotting you should be considering plotting real() or imag() or abs() of the fft()

More Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!