How to put in 3D graph?

3 views (last 30 days)
tiago
tiago on 10 Jun 2015
Answered: Star Strider on 10 Jun 2015
I'm doing an analysis of a EMG signal and want to put the spectogram in a 3D graph! Now i´m using the function imagesc but it gives me a 2D graph! what function do i use?
% perform STFT
[stft, f, t] = stft(Data, wlen, h, nfft, fs);
% take the amplitude of fft(x) and scale it, so not to be a
% function of the length of the window and its coherent amplification
SA = abs(stft)/wlen/K;
% correction of the DC & Nyquist component
if rem(nfft, 2) % odd nfft excludes Nyquist point
SA(2:end, :) = SA(2:end, :).*2;
else % even nfft includes Nyquist point
SA(2:end-1, :) = SA(2:end-1, :).*2;
end
% convert the amplitude spectrogram to dB
SA = 20*log10(SA);
figure(2)
imagesc(t, f, SA)

Answers (1)

Star Strider
Star Strider on 10 Jun 2015
See the documentation for 3D Spectrogram Visualization for details on how to code it.

Community Treasure Hunt

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

Start Hunting!