Image:STFT colored spectrogram 375ms.png

From Wikipedia, the free encyclopedia

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

[edit] Summary

Description

This picture is one of the four spectrograms I have created of the following signal:

x(t)=\begin{cases}
\cos (2 \pi 10 t);  & 0  \le t < 5  s \\
\cos (2 \pi 25 t);  & 5  \le t < 10 s \\
\cos (2 \pi 50 t);  & 10 \le t < 15 s \\
\cos (2 \pi 100 t); & 15 \le t < 20 s \\
\end{cases}

sampled at 400 Hz. I have created this picture and all the other three spectrograms with the following Matlab code, that is based on my stft script that you can find at User:Alejo2083/Stft script:

clear all;
 
%sampling frequency
fc=400;
%duration of the signal
T=20;
%zero padding factor
my_zero=10;
 
%generate the signal
t=linspace(0,T,fc*T);
x=zeros(1,length(t));
%thresholds
th1=0.25*T*fc;
th2=0.5*T*fc;
th3=0.75*T*fc;
th4=T*fc;
x(1:th1)=cos(2*pi*10*t(1:th1));
x((th1+1):th2)=cos(2*pi*25*t((th1+1):th2));
x((th2+1):th3)=cos(2*pi*50*t((th2+1):th3));
x((th3+1):th4)=cos(2*pi*100*t((th3+1):th4));
 
%calculate and show the spectrograms
[spectrogram, axisf, axist]=stft(x,10,1,fc,'blackman',my_zero);
spectrogram=spectrogram/max(spectrogram(:));
figure,imagesc(axist,axisf,spectrogram),
title('Spectrogram with T = 25 ms'),
ylabel('frequency [Hz]'),
xlabel('time [s]'), 
colorbar;
 
[spectrogram, axisf, axist]=stft(x,50,1,fc,'blackman',my_zero);
spectrogram=spectrogram/max(spectrogram(:));
figure,imagesc(axist,axisf,spectrogram),
title('Spectrogram with T = 125 ms'),
ylabel('frequency [Hz]'),
xlabel('time [s]'), 
colorbar;
 
[spectrogram, axisf, axist]=stft(x,150,1,fc,'blackman',my_zero);
spectrogram=spectrogram/max(spectrogram(:));
figure,imagesc(axist,axisf,spectrogram),
title('Spectrogram with T = 375 ms'),
ylabel('frequency [Hz]'),
xlabel('time [s]'), 
colorbar;
 
[spectrogram, axisf, axist]=stft(x,400,1,fc,'blackman',my_zero);
spectrogram=spectrogram/max(spectrogram(:));
figure,imagesc(axist,axisf,spectrogram),
title('Spectrogram with T = 1000 ms'),
ylabel('frequency [Hz]'),
xlabel('time [s]'), 
colorbar;

Feel free to improve the code, to speed it up or just make it clearer.

Source

self-made

Date

September 2007

Author

Alessio Damato

Permission
(Reusing this image)

see below

Other versions see below

The four spectrograms
25 ms window
25 ms window
125 ms window
125 ms window
375 ms window
375 ms window
1000 ms window
1000 ms window

[edit] Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation license, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation license".

Aragonés | العربية | Asturianu | Български | বাংলা | ইমার ঠার/বিষ্ণুপ্রিয়া মণিপুরী | Brezhoneg | Bosanski | Català | Cebuano | Česky | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | فارسی | Suomi | Français | Gaeilge | Galego | עברית | Hrvatski | Magyar | Bahasa Indonesia | Ido | Íslenska | Italiano | 日本語 | ქართული | ភាសាខ្មែរ | 한국어 | Kurdî / كوردی | Latina | Lëtzebuergesch | Lietuvių | Bahasa Melayu | Nnapulitano | Nederlands | ‪Norsk (nynorsk)‬ | ‪Norsk (bokmål)‬ | Occitan | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Shqip | Српски / Srpski | Svenska | తెలుగు | ไทย | Türkçe | Українська | اردو | Tiếng Việt | Volapük | Yorùbá | ‪中文(中国大陆)‬ | ‪中文(台灣)‬ | +/-

Some rights reserved
Creative Commons Attribution iconCreative Commons Share Alike icon
This file is licensed under the Creative Commons Attribution ShareAlike license versions 3.0, 2.5, 2.0, and 1.0

Български | Català | Česky | Dansk | Deutsch | Ελληνικά | English | Español | Euskara | Estremeñu | Français | עברית | Italiano | 日本語 | 한국어 | Lietuvių | Nederlands | ‪Norsk (bokmål)‬  | Occitan | Polski | Piemontèis | Português | Русский | 中文 | +/-

You may select the license of your choice.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current08:13, 18 September 2007560×420 (7 KB)Alejo2083 ({{Information |Description=working... |Source=self-made |Date=September 2007 |Author= Alessio Damato |other_versions= }} Category:Short-time Fourier transform Category:Spectrogram)
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):