% STA 293 % Thursday 10/7 % % SPECTROGRAM of a synthetic signal % LinChirp (increasing freq) + QuadChirp (decreasing freq). % % WindowFT -- Window Fourier Transform % Usage % specgm = WindowFT(sig,w,m,Name,titl) % Inputs % sig 1-d signal % w window half-length, default = n/2 % m inter-window spacing, default=1 % Name string: 'Rectangle', 'Hanning', 'Hamming', % 'Gaussian', 'Blackman'; Default is 'Rectangle' % titl Optional Title String Modifier % Outputs % specgm Window Fourier Transform of sig, n+1 by n complex matrix % Side Effects % Image Plot of the Window Fourier Transform % Description % Algorithm % supposes signal is non-periodic, i.e. zero-padded % Example % sig = ReadSignal('Caruso'); % sig = sig(1:128); % specgm = WindowFT(sig); % See Also % MakeWindow IWindowFT % References % Mallat, "A Wavelet Tour in Signal Processing"; % 4.2.3 Discrete Windowed Fourier Transform. % close all; N = 1024; f = MakeSignal('Chirps',N); % for nice plots delta = 1/15; unit = (1-3*delta)/3; h0 = [delta delta 1-2*delta 2*unit]; h1 = [delta 2*(unit+delta) 1-2*delta unit]; figure;clf; axes('position',h1); plot(f); axis([1 N min(f) max(f)]); axes('position',h0); window = 50; specgm = WindowFT(f,window,1,'Gaussian'); set(0, 'DefaultAxesFontSize', 12); set(0, 'DefaultAxesFontName', 'Times') print(gcf,'-deps', 'spectrogram.eps') %-------------------------------------------------------