0% found this document useful (0 votes)
125 views45 pages

Fourier Series Expansion of Periodic Signal: (With Period of T)

The document discusses using the Fast Fourier Transform (FFT) algorithm in MATLAB to analyze signals. It provides an example of using FFT to find the discrete Fourier transform (DFT) of a sampled signal consisting of 20 Hz and 40 Hz sinusoids. The FFT is applied to the sampled data and the magnitude of the resulting spectrum is plotted, showing peaks at 20 Hz and 40 Hz as expected. Time and frequency axes are properly labeled on the plots.

Uploaded by

Khaaliq DeJan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views45 pages

Fourier Series Expansion of Periodic Signal: (With Period of T)

The document discusses using the Fast Fourier Transform (FFT) algorithm in MATLAB to analyze signals. It provides an example of using FFT to find the discrete Fourier transform (DFT) of a sampled signal consisting of 20 Hz and 40 Hz sinusoids. The FFT is applied to the sampled data and the magnitude of the resulting spectrum is plotted, showing peaks at 20 Hz and 40 Hz as expected. Time and frequency axes are properly labeled on the plots.

Uploaded by

Khaaliq DeJan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Review

Fourier series expansion of periodic signal


(with period of T)

f (t )  a0   (ak cos kt bk sin kt ) TRIGNOMETRIC
k 1 2
(  )
T

f (t )  A0   Ak cos(kt  k ) COMPACT
k 1


f (t )  k
c e jkt

k  
EXPONENTIAL

(k  1,2,3,......)
Review
Fourier series expansion of periodic signal
1
a0 
T  f (t )dt
T

f (t )  a0   (ak cos kt bk sin kt ) ak 
2
 f (t ) cos(kt )dt
T
k 1 T

2 2
T

bk 
T  f (t ) sin(kt )dt
T


Ak  ak  bk
2 2

f (t )  A0   Ak cos(kt  k ) A0  a0
 bk
k 1 k  tan 1 ( )
ak

 ck e jkt 1
f (t )  ck   f (t )e  jkt dt
k   T T

( k  1,2,3,......)
Fourier series expansion of periodic signal

Step 1: Observe symmetry of the function f(t) (even or odd),


determine the period and fundamental frequency, and select
a complete cycle (period) for analysis. Express function f(t)
for the selected period

Step 2: Calculate Fourier coefficients a0 , ak , bk (k  1,2,3,......)

Step 3: Find A0 , Ak (k  1,2,...) for Fourier series expansion


in compact form

Use Matlab to help


plot Amplitude spectrum ( Ak vs. k ) and
phase spectrum ( k vs. k )
Review
• Exponential Fourier series expansion of a periodic signal

1
f (t )   ck e
k  
jkt
ck 
T 
T
f (t )e  jkt dt

 A non-periodic function f(t) (period of infinity) can be


represented as a sum of sin’s and cos’s of (possibly)
all frequencies:

1  
f (t )   F ( )e jt
d F ( )   f (t )e  jt dt
2  

Inverse Fourier transform Fourier transform (integral)


of f(t) of f(t)
Amplitude
Fourier series Amplitude Spectrum
expansion of A1
a periodic signal A2
A3 A
4 A
5

1 2 3 4 5 Harmonics
Magnitude
F ( )
Fourier transform
of a non-periodic
signal ( T0   )
T Spectrum
Fourier

f (t)
t Frequency
1
T0 f  (Hz)
T0
Terms:
- Fourier Transform (FT)

- Discrete Fourier Transform (DFT)

- Fast Fourier Transform (FFT)


• A fast algorithm for calculating DFT
Processing of Biosignals Using FFT
F(nf)
f[n]=f(nT)
DFT
n  n
fs
T 2
T0 = (N-1)T (N1)f  fs

1
Sampling rate (frequency): f s  ( Hz) Frequency resolution: f 1/ T0
T
Sampling interval: T (sec) Max. Frequency : fmax (Hz)

Number of samples: N (=2M) fs


f max 
Sample length: T0 (sec) = (N-1)T
2
Biosignals and Processing

Lecture 11 FFT and applications

Using Matlab command fft


Using Matlab fft command
Example 1: find the DFT of the following function:

x(t )  sin( 20t )  0.5 cos(40t )

Use a sampling frequency of 100 Hz and 256 samples


for the analysis.
Example 1 Matlab script
N=256; %%% sampling points
fs=100; %%% sampling rate (freq.)= 100 Hz
dt=1/fs; %%% sampling interval=0.01;

n=1:1:N;
xn=sin(20*pi*(n-1)*dt)+0.5*cos(40*(n-1)*dt);

figure %%%%%%%%%% plot sampled x(t) sequence x[n]


plot(n,xn,'.-')

xf=fft(xn,N); %%%%%%%% Find fft of x(t), expressed as xf


mag=abs(xf); %%% calculate the magnitude of xf

figure
plot(n,mag,'.-') %%%%%%% plot magnitude
Example 1 figures from Matlab
x(nt) 1.5

0.5

-0.5

-1

-1.5
0 50 100 150 200 250 300

X(n) 100

80

60

40

20

0
0 50 100 150 200 250 300
Example 1 Matlab script (add time and frequency units)
N=256; %%% sampling points
fs=100; %%% sampling rate (freq.)= 100 Hz
dt=1/fs; %%% sampling interval=0.01;
t=0:dt:(N-1)*dt; %%% length: (N-1)*dt
xt=sin(20*pi*t)+0.5*cos(40*t);
figure %%%%%%%%%% plot x(t)
plot(t,xt,'.-')
xlabel('Time (sec)')
ylabel('x(t)')
xf=fft(xt,N); %%%%%%%%Find fft of x(t)
Mag=abs(xf); %%% calculate the magnitude of X(f)
df=1/(N-1)/dt %%% df: frequency resolution
freq=0:df:fs;
figure,
plot(freq(1:N/2),Mag(1:N/2),'.-') %%% plot magnitude vs. frequency
grid
xlabel('Frequency (Hz)')
ylabel('Magnitude')
figure, %%%% plot magnitude in dB
plot(freq(1:N/2),20*log10(Mag(1:N/2)),'.-')
grid
xlabel('Frequency (Hz)')
ylabel('Magnitude (dB)')
title(‘Fourier Spectrum’)
Example 1 figures from Matlab
1.5 100
Fourier spectrum
90
1
80

Magnitude
70
0.5
60

Magnitude
x(t)

0 50

40
-0.5
30

20
-1
10

-1.5 0
0 5 10 15 20 25 30 35 40 45 50
0 0.5 1 1.5 2 2.5 3
Frequency (Hz)
Time (sec)
40
Fourier spectrum
Fourier Spectrum

30
Magnitude (dB)

20
Magnitude (dB)

10

-10

-20
0 5 10 15 20 25 30 35 40 45 50
Frequency (Hz)
Sampling, DFT/FFT, and STFT

• Sampling Theorem
-Discrete Fourier Transform (DFT)
/Fast Fourier Transform (FFT)

• Short-Time-FT (STFT) or Spectrogram


Sampling Theorem
 If a signal contains the highest frequency
fmax, the sampling frequency (rate)
(fs) >= 2 fmax

 Nyquist frequency (rate): fNyquist = 2 fmax

 The sampling theory insures that the


digitized signal truly represents the original
analog signal (No loss of information)
 Insufficient sampling rate time results in
aliasing
Aliasing
• A characteristic of the A/D process (converting
from an analogue signal to a digital signal)

• Caused by insufficient sampling frequency (rate) -


a higher frequency ‘folds over’ into the lower
frequencies

• This can be illustrated by taking a simple signal of


1000Hz and steadily reducing the sampling rate:

3000 Hz, … 2000Hz, …. 1000 Hz


Aliasing
Original: (1000Hz)

Sampled at 3000Hz:

Sampled at 1800Hz:

Sampled at 1500Hz:

Sampled at 1200Hz:

Estimate the frequency in each case…


Aliasing
Original: (1000Hz)

Sampled at 3000Hz: Estimated: 1000Hz

Sampled at 1800Hz: Estimated: 850Hz

Sampled at 1500Hz: Estimated: 500Hz

Sampled at 1200Hz: Estimated: 250Hz

Estimate the frequency in each case…


Aliasing

Estimated frequencies are plotted against sampling


frequency:
normal

1000Hz
Estimated
frequency

500Hz aliased

Sampling
frequency

1000Hz 1200 1500 1800 2000Hz

20
Aliasing

What is the affect on speech?

Original (max: 1000 Hz):

Sampled at 2000Hz:
Alias:
Sampled at 1000Hz: Frequencies greater
than 500Hz sound
Folded over as lower
frequencies, creating
distortion

21
Sampling Theorem
 If a signal contains the highest frequency fmax,
the sampling frequency (rate)
(fs) >= 2 fmax

 Nyquist frequency: fNyquist = 2 fmax

 The sampling theory insures that the digitized


signal truly represents the original analog signal
(No loss of information)
Analog-to-Digital (A/D) Converter
 Analog input

 Anti-alias Filter

 Sampling

 Quantization

 Digital output
A sampling rate of 200 Hz is not adequate
to sample a 360 Hz signal
Original signal
360 Hz signal, T=0.00278 sec

Frequency:
f=360 Hz;

Period:
T=1/360 (sec)

Sampling rate: 200Hz


40 Hz signal, T=0.025 sec

Signal reconstructed
after sampling
Conventional Clinical Tool: Videostroboscopy
Vocal Fold Cycles
Open
Apparent
Closed
Motion
Strobe flash

 Stroboscope shows an apparent motion,


or a slowed down motion !!
High-speed Imaging of the larynx
Sampling rate: 2000 Hz

Sustained phonation of /i/ at normal pitch:


f0 ~ 200 Hz

Glottal Area Waveform (GAW) Normal voice


Open

Closed
0.005 sec
1 vibratory cycle

50 image frames (2000 f/sec) 0.025 sec of recording)


Vocal fold vibrations captured at different
recording rate

Video-stroboscopy High-speed imaging


sampled at 25 Hz sampled at 2000 Hz
Vocal fold Vibrations in normal and
pathological voicing
Leukoplakia

Normal voice
Example 1: Signal processing by DFT/FFT
Noisy Sine wave
Sine wave
Original signal

FFT spectrum FFT spectrum


Example 2: Signal processing bypage
Textbook DFT
Originalofsignal
Upstroke: contraction of the ventricles the
heart; Downward: ventricular relaxation

Systolic
pressure

Diastolic
pressure
Example 2: Signal processing by DFT
FFT spectrum
Example 3: Vocal signal processing by DFT
Sound Pressure

Sound radiation
from lips
Vocal tract: Larynx
filter and
amplifier Sound
propagation in
the vocal tract

Vocal fold:
Source of Sound

Source filter model of speech production (Fant, 1960)


One-mass model 3-mass model (Titze,1995)

Pi

Ps

mx  bx  kx  P
Signal from the sound source: (vocal fold vibration)
1

0.5
GAW (Normalized)

-0.5

-1
10 20 30 40 50 60 70 80 90 100
FFT
Time (ms) Power Spectrum
5
10

FFT
4
10 Spectrum
Normal Voice Condition 3
10

2
10

0 200 400 600 800 1000


Frequency (Hz)

280 Hz 560Hz 840 Hz


Sound output (after travelling through the vocal tract)
acquired by a microphone
1
Acoustic data (Normalized)

0.5

-0.5

-1
10 20 30 40 50 60 70 80 90 100
Time (ms)

FFT Power Spectrum

FFT
4 2
10

3 Spectrum
Normal Voice 10
3

Condition 10
2

1
10

0 500 1000 1500 2000


Frequency (Hz)
Comparison: vocal-fold vibration vs. sound waves
FFT Power Spectrum
5
10

4
10

10
3 2 DFT of the Vocal fold Vibration
10
2 3
0 200 400 600 800 1000
Frequency (Hz)
FFT Power Spectrum

4
10
2
3
3
10 DFT of the
2
10
sound output
1
10

0 500 1000 1500 2000


Frequency (Hz)

 Knowledge of the source-tract transfer function helps understand the


mechanism of voice production;
 Speech synthesis requires understanding of the vocal tract dynamic properties
Voice pathology: Muscle Tension Dysphonia (MTD)
Vocal fold source signal

Period
(ms)
Sound wave signal
Spectral analysis of MTD voice
FFT Power Spectrum

f
3f/2
4
10 2f 5f/2
f/2
3
10 3f
GAW

2
10

1
10

0 100 200 300 400 500 600 700 800 900 1000
Frequency (Hz)

Sub-harmonics
Short-time Fourier Transform (STFT)

• STFT: FFT analysis of short, consecutive


segments of a signal;

• A type of time-frequency analysis ;


effective for analysis of time-varying signals

• Provide information on both time and frequency

• STFT is also called Spectrogram

• Can be plotted in 3-D or displayed as image


STFT: Time-frequency Analysis

(Time)
STFT: Time-frequency Analysis
STFT of EEG displayed in 3D plot

Amplitude

6 Hz

EEG signals recorded on stimulations (6, 10, 15 and 20Hz)


EEG examination of Epilepsy
Epilepsy: genetic disorder caused by mutation in
single ion channel

 Patients with suspected epilepsy usually undergo EEG


examination upon a photo stimulation;

 The technique is used to trigger epileptic potentials by


repeated light flashes (at a rate of 10 ~ 30 Hz)

 Patient suffering from epilepsy possibly exhibits a repetitive


spike-wave pattern which occur at ~ 3/second.
Spectrogram of EEG at the onset of an
epileptic seizure displayed in grey-scale image
Original signal

Time (s)
Spectrogram

Time (s)

Amplitude is expressed in brightness


Spectrogram of a speech signal displayed in color image
Decibel (dB): logarithmic unit
5000 20
4500
1200
dB  20 log10 ( A)
4000 0
3500
1000
Frequency (Hz)

3000 -20
800
Frequency

2500
600
2000 -40
1500 400
1000
-60
200
500

0
0 0.2
00.4 0.6
0 0.10.8 10.2 1.2 1.4
0.3 1.6 1.8
0.4 2 0.5
Time
Time (sec)

You might also like