help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spectrogram of signal


From: Doug Stewart
Subject: Re: Spectrogram of signal
Date: Thu, 30 Aug 2012 09:21:34 -0400



On Thu, Aug 30, 2012 at 9:12 AM, Rick T <address@hidden> wrote:
Greetings All

I'm trying to test the specgram function located in the signal package in octave but I'm a little confused at the variables in specgram.  What I would like to do is be able to get the specgram data into an array that will show the frequency and the length of time when the frequency starts and stops

See example code below: I was trying to get the array to show that for the length of t1 will be 7hz, t2 will be 12hz and for t3 will be 2hz.  How can I go about doing this?

I'm using ubuntu 12.04 and octave 3.2.4 and the signal pacakage 1.0.11


% combines sig with spectra plot
clear all,clc,tic;
fs=1000;
t1=linspace(0,2*pi,fs/0.1); %need to round off no decimals
t2=linspace(0,2*pi,fs/0.3); %need to round off no decimals
t3=linspace(0,2*pi,fs/0.6); %need to round off no decimals

%Create signal in different arrays
y1=sin(7*t1);
y2=sin(12*t2);
y3=sin(2*t3);

%append arrays to test specgram
yt = [y1 y2 y3];


%plot(yt) %will show combined plot

%Spectrum section
yts=specgram(yt',20,500, 2,1);
plot(yts)
fprintf('\nfinally Done-elapsed time -%4.4fsec- or -%4.4fmins- or -%4.4fhours-\n',toc,toc/60,toc/3600);

_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


Hi Rick.

1) Does specgram give you a picture?

2) Do You understand the picture?

3) Do you understand what the window function does?

4) Instead of a picture can you get an array of data?

Doug



--
DAS

https://linuxcounter.net/user/206392.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]