相关疑难解决方法(0)

使用MATLAB获取信号的包络

我正在尝试提取音频文件的峰值.我有以下代码来提取振幅谱的包络.但是我没有得到所需的输出图.有人可以告诉我需要做些什么调整来获得正确的图表.这是我的代码:

[song,FS] = wavread('c scale fast.wav');


P=20000/44100*FS;                   % length of filter 
N=length(song);                     % length of song
t=0:1/FS:(N-1)/FS;                  % define time period
% Plot time domain signal
figure(1);
subplot(3,1,1)
plot(t,(3*abs(song)))
title('Wave File')
ylabel('Amplitude')
xlabel('Length (in seconds)')
xlim([0 1.1])

xlim([0 N/FS])


% Gaussian Filter
x = linspace( -1, 1, P);         % create a vector of P values between -1 and 1 inclusive
sigma = 0.335;                  % standard deviation used in Gaussian formula
myFilter = -x .* exp( -(x.^2)/(2*sigma.^2));% compute first derivative, but …
Run Code Online (Sandbox Code Playgroud)

matlab envelope

5
推荐指数
1
解决办法
3万
查看次数

标签 统计

envelope ×1

matlab ×1