How do I plot a 3-D graph of an audio signal that show whole signal amplitude VS time(s) VS frequency(hz)?

6 visualizaciones (últimos 30 días)
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!

Respuestas (1)

Star Strider
Star Strider el 16 de Ag. de 2014
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:
  • [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.

Categorías

Más información sobre Simulation, Tuning, and Visualization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by