Moving Average Filter for audio

Hi! I have created my an audio file using my voice, and now I have to use moving average filter. I was only given a value of h. Ive been trying to look for other examples of MAF applied on this but theres none. I couldnt get the right output. I used conv

Respuestas (1)

Walter Roberson
Walter Roberson el 13 de Jul. de 2021

0 votos

If you have already obtained the entire signal, then you can use movmean() if your MATLAB is new enough. However, conv() can also work well.

3 comentarios

Cherri Ann
Cherri Ann el 13 de Jul. de 2021
when i use y2 = conv (y, h) it shows the same output as the original. Is it right?
Walter Roberson
Walter Roberson el 13 de Jul. de 2021
What is your h value? You would get the same output as the original if your h was scalar 1.
load handel
y = y(1:256);
plot(y)
ysc = conv(y, ones(1,20)/20, 'valid');
plot(ysc)
ysmm = movmean(y, 20, 'endpoints', 'discard' );
plot(ysmm)
max(abs(ysc-ysmm))
ans = 2.7756e-17
You can see that the two computation methods are equivalent.

Iniciar sesión para comentar.

Categorías

Más información sobre Audio I/O and Waveform Generation en Centro de ayuda y File Exchange.

Preguntada:

el 13 de Jul. de 2021

Comentada:

el 13 de Jul. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by