32
79 III. Gabor Transform 2 ( ) /2 ,3 , t j x G t e e x d 2 ( ) 2 , t j f x G tf e e x d Alternative Definitions: 2 ( ) 2 4 ,2 , 2 t j f x G tf e e x d 2 ( ) ( ) 2 2 ,4 1 , 2 t t j x G t e e x d III-A Definition Standard Definition: 2 2 ( ) ( ) 2 ,1 , t j f t x G tf e e x d normalization

79 III. Gabor Transform

  • Upload
    others

  • View
    53

  • Download
    1

Embed Size (px)

Citation preview

Microsoft PowerPoint - TFW3.pptxxG t e e x d









Main Reference
• S. Qian and D. Chen, Sections 3-2 ~ 3-6 in Joint Time-Frequency Analysis: Methods and Applications, Prentice-Hall, 1996.
Other References
• D. Gabor, “Theory of communication”, J. Inst. Elec. Eng., vol. 93, pp. 429-457, Nov. 1946. ( Gabor transform) • M. J. Bastiaans, “Gabor’s expansion of a signal into Gaussian elementary signals,” Proc. IEEE, vol. 68, pp. 594-598, 1980. • R. L. Allen and D. W. Mills, Signal Analysis: Time, Frequency, Scale, and Structure, Wiley- Interscience. • S. C. Pei and J. J. Ding, “Relations between Gabor transforms and fractional Fourier transforms and their applications for signal processing,” IEEE Trans. Signal Processing, vol. 55, no. 10, pp. 4839-4850, Oct. 2007.
81

Gabor transform short-time Fourier transform (STFT) Gabor transform STFT special case.
82 III-B Approximation of the Gabor Transform
Although the range of integration is from − to , due to the fact that
when |a| > 1.9143
when |a| > 4.7985
2
0.00001ae
G t f e e x d





2 / 2 0.00001ae
83 III-C Why Do We Choose the Gaussian Function as a Mask
(1) Among all functions, the Gaussian function has the advantage that the area in time-frequency distribution is minimal.
( STFT time-domain frequency domain )
w(t) time domain
w(t) W(f) = FT[w(t)] frequency domain
(2) Gaussian function FT eigenfunction Gabor transform time domain frequency domain
2 22t j f t fe e dt e


For a signal x(t), if when |t| , then
σt σf 1/4π
0t x t
2 2( )t t xt P t dt 2 2( ) ,f f Xf P f df
,t xt P t dt ( )f Xf P f df
2
2
| ( ) | , | ( ) |x


2 2 2 2 2
2 2 2
x t dt x t dt


2 2| ( ) | | ( ) |x t dt X f df if X(f) = FT[x(t)]
Then, use Parseval’s theorem
From simplification, we consider the case where μt = μf = 0
86
2 2


(using |a+b|2 + |a–b|2 2|a|2 )
2( ), ( ) ( ), ( ) ( ), ( )x t x t y t y t x t y t
2 2
t t
dt x t x t dt tx t x t x t x t dt dt
tx t x t tx t x t x t x t dt
x t dt
2

22 2 ?tx t dt e dt

2 222 2 2 2 2

use
2
1/ 2 1n n n
[] M. R. Spiegel, Mathematical Handbook of Formulas and Tables, McGraw-Hill, 3rd Ed., 2009.
88 2 2
Special relation between the Gaussian function and the rectangular function
Gaussian function is also an eigenmode in optics, radar system, and other electromagnetic wave systems.
(will be illustrated in the 8th week)
90
t-axis
-4 -3 -2 -1 0 1 2 3 4 -4
-3
-2
-1
0
1
2
3
4
s t-axis-4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
0
1
2
3
4
rec-STFT, B = 0.5 for Gaussian function exp(t2)
91 x(t) = cos(2 t) when t < 10, x(t) = cos(6 t) when 10 t < 20, x(t) = cos(4 t) when t 20
Time (Sec)
Fr eq
ue nc
y (H
z) Gabor
-4
-3
-2
-1
0
1
2
3
4
5
92
2 2exp / 2 6 exp ( 4) /10r t jt j t t
Gabor transform of r(t)
-4
-3
-2
-1
0
1
2
3
4
t-axis
Gabor transform of s(t)
-10 -5 0 5 10 -4
-3
-2
-1
0
1
2
3
4
-10 -5 0 5 10 -4
-3
-2
-1
0
1
2
3
4
(2) Shifting property
(3) Modulation property
If y(t) = x(t)exp(j2f0t), then





y xG t f G t t f e
0, ,y xG t f G t f f
III-E Properties of Gabor Transforms
95 (4) Special inputs:
(symmetric for the time and frequency domains)
(5) Linearity property If z( ) = x( ) + y( ) and Gz(t, f ), Gx(t, f ) and Gy(t, f ) are their
Gabor transforms, then
(6) Power integration property:
22, j f t f xG t f e e
2 21.91432 2 22 ( ) 2 ( )
1.9143 ,

If x(t ) = 0 for t > t0, then .
i.e., for t > t0.
for f > f0.

(fix , vary ) (fix , vary ) average of , average of ,t t
x x t f t f
G t f e G t f
( ) 0X f FT x t
2 0
(fix , vary ) (fix , vary ) average of , average of ,f f
x x f t f t
G t f e G t f
20 ( ) 2, t t j f
xG t f e e x d
20
0( ) 2 0 ,

2 0( )
0, ,t t x xG t f e G t f
2 22 0 0( ) ( )( ) t t tte e e
97 (8) Energy sum property
where Gx(t, f ) and Gy(t, f ) are the Gabor transforms of x( ) and y( ), respectively.

98 III-F Scaled Gabor Transforms


lower resolution in the frequency domain
smaller σ: higher resolution in the frequency domain
lower resolution in the time domain
(finite interval form)
-4 -3 -2 -1 0 1 2 3 4 -4
-3
-2
-1
0
1
2
3
4
= 0.2
= 5
-4 -3 -2 -1 0 1 2 3 4 -4
-3
-2
-1
0
1
2
3
4
(1) Using the generalized Gabor transform with larger σ
(2) Using other time unit instead of second
t (sec) f ( Hz)

when instantaneous frequency varies slowly smaller σ
S. C. Pei and S. G. Huang, “STFT with adaptive window width based on the chirp rate,” IEEE Trans. Signal Processing, vol. 60, issue 8, pp. 4065- 4080, 2012.
For a signal,
xG t f t e e x d

102 Matlab
(3)
(5)
Program
103 Matlab
(1) function:
(2) tic, toc:
tic toc
find(abs([-5:5])<=2) = [4, 5, 6, 7, 8]
( abs([-5:5])<=2 = [0 0 0 1 1 1 1 1 0 0 0])
(4) : Hermitian (transpose + conjugation) . : transpose
(5) imread: image, imshow, imagesc:
( Matlab imread double
A=double(imread(‘Lena.bmp’));
(6) imwrite:
(8) xlswrite: Excel
(9) aviread: video avi
(10) VideoReader: video
(11) VideoWriter: video
(12) dlmread: *.txt
(13) dlmwrite: *.txt
Python
y() y
import numpy as np import matplotlib.pyplot as plt C = 400 y = np.abs(y) / np.max(np.abs(y)) * C plt.imshow(y, cmap='gray', origin='lower') # origin='lower'
plt.xlabel('Time (Sec)') plt.ylabel('Frequency (Hz)') plt.show() 2021
105
(plt.show())
y_label = [‘-5’, ‘0’, ‘5’] #
plt.xticks(np.arange(0, x_max, step=int(x_max/(len(x_label)-1)), x_label) plt.yticks(np.arange(0, y_max, step=int(y_max/(len(y_label)-1)), y_label)
Reference : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.xticks.html
106
end_time = time.time() total_time = end_time - start_time #

pip install numpy pip install scipy pip install scipy pip install opencv-python
2021
107
(4) array
( Matlab find ) import numpy as np a = np.array([0, 1, 2, 3, 4, 5]) index = np.where(a > 3) # array([4, 5]) print(index)
(array([4, 5], dtype=int64),) index[0][0]
4 index[0][1]
108
A1= np.array([[1,3,6],[2,4,5]]) index = np.where(A1 > 3) print(index)
(array([0, 1, 1], dtype=int64), array([2, 1, 2], dtype=int64)) (A1 > 3 [0, 2], [1, 1], [1, 2]
[index[0][0], index[1][0]] [0, 2]
[index[0][1], index[1][1]] [1, 1]
[index[0][2], index[1][2]] [1, 2]
1 3 6 2 4 5

(5) Hermitiantranspose import numpy as np result = np.conj(matrix.T) # Hermitian result = matrix.T # transpose
data = scipy.io.loadmat('***.mat') y = np.array(data['y']) # y ***.mat
(6) Matlab mat
110