Moving Average Filter for audio
6 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Walter Roberson
2021-7-13
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 个评论
Walter Roberson
2021-7-13
What is your h value? You would get the same output as the original if your h was scalar 1.
Walter Roberson
2021-7-13
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))
You can see that the two computation methods are equivalent.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


