May I ask how to get the value of amplitude from one wav. file?
9 次查看(过去 30 天)
显示 更早的评论
May I ask how to get the value of amplitude from one wav. file? Because I want to do distortion wav. file..
0 个评论
采纳的回答
Image Analyst
2016-4-29
The amplitude is the value of the array at that element. If you want the max value over all elements, use max().
[y,Fs] = audioread('guitartune.wav'); % y can have + and - amplitudes.
amplitudes = abs(y); % abs(y) is the amplitudes in an all-positive sense
maxY = max(abs(y)); % maxY is the highest amplitude.
7 个评论
Image Analyst
2016-4-30
You can simply use multiplication and division to scale your vector or matrix to anything you want.
desiredMax = 0.1;
yScaled = y * desiredMax / maxY;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Measurements and Statistics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!