Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: STFT Spectrogram axes
Replies: 1   Last Post: Sep 18, 2013 6:43 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bizuayehu Mohammed

Posts: 18
Registered: 5/14/09
STFT Spectrogram axes
Posted: Sep 18, 2013 5:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,
I used STFT spectrogram, when I plot the contour on time-frequency plot. The x-axis (time) starts from 25.4 not 0. I want it to start from 0. Below is the code I wrote.
clear all;
close all;
clc;
a=uigetfile('.txt');
b=dlmread(a);
x=b(:,1); % data length is 3000 and sampling rate is 5000000.
tt=0:0.2:(length(x)-1)*0.2; % The sampling rate is 5000000, multiplied it to find %time in micro seconds.
% tt=0:0.2:(length(x)-1)*0.2; % time
[y,f,t,p]=spectrogram(x,256,255,[],5000000,'yaxis');
subplot(212)
surf(t,f,abs(p),'EdgeColor','none');
axis xy; axis tight; colormap(jet);
view(0,90);
subplot(211)
plot(tt,x) % plots the signal in time.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.