- [S,F,T] = spectrogram(...) returns a vector of frequencies, F, and a vector of times, T, at which the spectrogram is computed. F has length equal to the number of rows of S. T has length k (defined above) and the values in T correspond to the center of each segment.
How do I plot a 3-D graph of an audio signal that show whole signal amplitude VS time(s) VS frequency(hz)?
6 次查看(过去 30 天)
显示 更早的评论
Hi there!
I'm trying to plot a 3-D plot of my audio file that shows the Amplitude, Frequncy(Hz) and Time(s).Can this be done with surf function? What method is the easiest/shortest way to do the task? This is the code I'm using:
[input, fs] = wavread('address.wav');
L = length(input)./fs; % duration of the audio file in seconds
Ts = 1/fs; % sampling period
t= 0:Ts:L-Ts; % time vector
N= length(t); % length of time vector =15360
F= fs/N;
f= (-fs/2):F:(fs/2)-F; % frequncy vector
Thank You in advance!
0 个评论
回答(1 个)
Star Strider
2014-8-16
See the Signal Processing Toolbox spectrogram function. It can produce the data you need from your .wav file, and one of the 3D plotting functions (consider mesh, surf, ribbon) can do the plots.
From the spectrogram documentation:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!