Frequency wavelet transformation when drawing FIG.

Original: https://blog.csdn.net/weixin_40583722/article/details/79892289


First, draw the principle:

Cwt three functions need to use the wavelet toolbox (), centfrq (), scal2frq ()


 
 

COEFS = cwt (S, SCALES, 'wname')
 
 
of the continuous wavelet transform function, where S is the input signal, the SCALES for the scale, by wname, wavelet name.


 
 

 

FREQ = centfrq ( 'wname')
 
 
which function to find the center frequency of the mother wavelet wname named.


 
 

 

F = scal2frq (A, 'wname ', DELTA)
 
 
This function can be converted to the actual frequency scale, where A is a scale, the wavelet by wname, name, DELTA is the sampling period.


 
The relationship between the scale and frequency

Let a scale, fs is the sampling frequency, the Fc wavelet center frequency, then a corresponding actual frequency Fa is Fa = Fc * fs / a, obviously, according to the sampling theorem, to the frequency range Scalogram is (0, fs / 2), the range of the scale should be (2 * Fc, inf), where inf represents infinity. In practice, just large enough scale to take.


 
To determine the sequence of scale

As can be seen from the above equation, the frequency of the converter to the sequence is a sequence of arithmetic, scale sequence must take the following form: c / totalscal, c / (totalscal-1), ..., c / 2, c wherein , totalscal a sequence length scale (usually pre-programmed) used when the wavelet transform the signal, c is a constant. The actual frequency scale c / totalscal corresponding should fs / 2, may then be obtained c = 2 * Fc * totalscal sequence thus obtained the required dimensions.

 

Time-frequency sketch

After determining wavelet basis and scale, we can find use cwt wavelet coefficients coefs (coefficient to modulo complex number), and then scal2frq the scale sequence into the actual frequency sequences F, Finally time series t, with the imagesc (t, f, abs (coefs)) when the pilot will be able to draw the wavelet FIG.  

Second, the application examples
are given below to illustrate a practical example when the wavelet frequency is plotted in FIG. Simulated signal taken by the frequency of 50Hz and 100Hz two sinusoidal components of the synthesized signal, respectively.

Frequency analysis% wavelet
CLC
Clear All
Close All
% original signal
FS = 1000;
F1 = 50;
F2 = 100;
T = 0:. 1 / FS:. 1;
S = SiN (2 * PI * F1 * T) + SiN ( * F2 * PI * 2 T);
Figure
Plot (T, S)
% continuous wavelet transform
wavename = 'cmor3-3';
totalscal = 256;
the Fc = centfrq (wavename);% wavelet center frequency
c = 2 * Fc * totalscal;
scals = C ./ (. 1: totalscal);
F = scal2frq (scals, wavename,. 1 / FS);% convert to frequency scale
coefs = cwt (s, scals, wavename);% seek continuous wavelet coefficients
Figure
the imagesc (T, F, ABS (coefs));
SET (GCA, 'YDir', 'Normal')
the colorbar;
the xlabel ( 'time T / S');
( 'frequency F / Hz') ylabel;
title ( 'Using wavelet FIG frequency ');
 

 

 

Description:
In this example, the best choice of morlet complex wavelet, wavelet not analyze the effect of the other, and morlet wavelet center frequency and bandwidth parameter made larger, when the frequency of FIG frequency concentration reflects the better.
 
Comparison with other time-frequency analysis, time-frequency plots as short time Fourier transform

 
summary:


When the high-frequency wavelet good effect, since the wavelet resolution can be adjusted automatically at a high frequency, high resolution.

 

 

Frequency Analysis%
CLC
Clear All
Close All
% original signal
FS = 1000;
F1 = 50;
F2 = 100;
T = 0:. 1 / FS:. 1;
S = SiN (2 * PI * F1 * T) + SiN (2 PI * F2 * T *); randn% + (. 1, length (T));
% S = Chirp (T, 20,0.3,300);
S = Chirp (T, 20,1,500, 'Q');
Figure
Plot (T, S)
% frequency FIG continuous wavelet transform
wavename = 'cmor3-3';
totalscal = 256;
the Fc = centfrq (wavename); the center frequency of the wavelets%
C = 2 * * the Fc totalscal;
scals = C /. (. 1: totalscal);
F = scal2frq (scals, wavename,. 1 / FS);% converted scale frequency
coefs = cwt (s, scals, wavename);% seek continuous wavelet coefficients
Figure
the imagesc (T, F, ABS ( coefs));
SET (GCA, 'YDir', 'Normal')
the colorbar;
the xlabel ( 'time t / s');
ylabel ( 'frequency F / Hz');
title ( 'Frequency wavelet FIG');
Frequency view% Short Time Fourier Transform
Figure
Spectrogram (S, 256,250,256, FS);
frequency analysis toolbox when short% Fourier transform
F = 0: FS / 2;
TFR = tfrstft (S ');
TFR TFR = (. 1: Floor (length (S) / 2), :);
Figure
the imagesc (T, F, ABS (TFR) );
SET (GCA, 'YDir', 'Normal')
the colorbar;
the xlabel ( 'time T / S');
ylabel ( 'frequency F / Hz');
title ( 'frequency view STFT') ;

 

Released seven original articles · won praise 13 · views 20000 +

Guess you like

Origin blog.csdn.net/xingsongyu/article/details/103495737
Recommended