SLIDE 1 Fourier representation of signals
Pouyan Ebrahimbabaie Laboratory for Signal and Image Exploitation (INTELSIG)
- Dept. of Electrical Engineering and Computer Science
University of Liรจge Liรจge, Belgium Applied digital signal processing (ELEN0071-1) 19 February 2020
MATLAB tutorial series (Part 1.1)
SLIDE 2 Contacts
- Email: P.Ebrahimbabaie@ulg.ac.be
- Office: R81a
- Tel: +32 (0) 436 66 37 53
- Web:
http://www.montefiore.ulg.ac.be/~ebrahimbab aie/
2
SLIDE 3
Fourier analysis is like a glass prism
Glass prism
Analysis
Beam of sunlight
Violet Blue Green Yellow Orange Red
SLIDE 4 Fourier analysis is like a glass prism
4
Glass prism
Analysis
Beam of sunlight
Violet Blue Green Yellow Orange Red
Beam of sunlight
Synthesis
White light
SLIDE 5 Fourier analysis in signal processing
- Fourier analysis is the decomposition of a signal into
frequency components, that is, complex exponentials
Original signal
SLIDE 6 Fourier analysis in signal processing
- Fourier analysis is the decomposition of a signal into
frequency components, that is, complex exponentials
Sinusoidal signals Original signal
=
Joseph Fourier 1768-1830
SLIDE 7
Motivation Question: what is our motivation to describe each signal as a sum or integral of sinusoidal signals?
SLIDE 8
Motivation Question: what is our motivation to describe each signal as a sum or integral of sinusoidal signals? Answer: the major justification is that LTI systems have a simple behavior with sinusoidal inputs. Notice: the response of a LTI system to a sinusoidal is sinusoid with the same frequency but different amplitude and phase.
SLIDE 9
Motivation Question: what is our motivation to describe each signal as a sum or integral of sinusoidal signals? Answer: the major justification is that LTI systems have a simple behavior with sinusoidal inputs. Interesting application: we can remove selectively a desired frequency ๐๐ from the original signal using an LTI system (i.e. โFilterโ) by setting ๐ฐ ๐๐๐๐ = ๐.
SLIDE 10 Notations and abbreviations Mathematical tools for frequency analysis depends on,
- Nature of time: continuous or discrete
- Existence of harmonic: periodic or aperiodic
SLIDE 11 Notations and abbreviations Mathematical tools for frequency analysis depends on,
- Nature of time: continuous or discrete
- Existence of harmonic: periodic or aperiodic
The signal could be, Continuous-time and periodic Continuous-time and aperiodic Discrete-time and periodic Discrete-time and aperiodic
SLIDE 12 Notations and abbreviations Mathematical tools for frequency analysis depends on,
- Nature of time: continuous or discrete
- Existence of harmonic: periodic or aperiodic
The signal could be, Continuous-time and periodic (freq. dom. CTFS) Continuous-time and aperiodic (freq. dom. CTFT) Discrete-time and periodic (freq. dom. DTFS) Discrete-time and aperiodic (freq. dom. DTFT)
SLIDE 13 Notations and abbreviations Mathematical tools for frequency analysis depends on,
- Nature of time: continuous or discrete
- Existence of harmonic: periodic or aperiodic
The signal could be, Continuous-time and periodic (freq. dom. CTFS) Continuous-time and aperiodic (freq. dom. CTFT) Discrete-time and periodic (freq. dom. DTFS) Discrete-time and aperiodic (freq. dom. DTFT) Notice: when the signal is periodic, we talk about Fourier series (FS).
SLIDE 14 Notations and abbreviations Mathematical tools for frequency analysis depends on,
- Nature of time: continuous or discrete
- Existence of harmonic: periodic or aperiodic
The signal could be, Continuous-time and periodic (freq. dom. CTFS) Continuous-time and aperiodic (freq. dom. CTFT) Discrete-time and periodic (freq. dom. DTFS) Discrete-time and aperiodic (freq. dom. DTFT) Notice: when the signal is aperiodic, we talk about Fourier transform (FT).
SLIDE 15 Continuous-time periodic signal: CTFS
2p
W0
T0
=
Continuous - time signals
x(t)
Time-domain Frequency-domain Continuous and periodic Discrete and aperiodic
t ck W
T
SLIDE 16 Continuous-time periodic signal: CTFS
2p
W0
T0
=
Continuous - time signals
x(t)
Time-domain Frequency-domain Continuous and periodic Discrete and aperiodic
t ck W
T
SLIDE 17
From CTFS to CTFT Example: consider the following signal,
SLIDE 18
From CTFS to CTFT Example: consider the following signal,
SLIDE 19
From CTFS to CTFT
SLIDE 20
From CTFS to CTFT
SLIDE 21
From CTFS to CTFT
SLIDE 22
From CTFS to CTFT
SLIDE 23
Continuous-time aperiodic signal: CTFT
SLIDE 24
Continuous-time aperiodic signal: CTFT
SLIDE 25
Continuous-time aperiodic signal: CTFT
SLIDE 26 Discrete-time periodic signal: DTFS
Discrete -time signals
x[n]
ck
N
Discrete and periodic Discrete and periodic
n k
Time-domain Frequency-domain
N
SLIDE 27 Discrete-time periodic signal: DTFS
Discrete -time signals
x[n]
ck
N
Discrete and periodic Discrete and periodic
n k
Time-domain Frequency-domain
N
SLIDE 28 Discrete-time aperiodic signal: DTFT
D iscrete-tim e signals
X(ejw)
2 4
p 2p
Continous and periodic
n
w
Tim e-dom ain Frequency-dom ain
Discrete and aperiodic
x[n]
SLIDE 29 Discrete-time aperiodic signal: DTFT
D iscrete-tim e signals
X(ejw)
2 4
p 2p
Continous and periodic
n
w
Tim e-dom ain Frequency-dom ain
Discrete and aperiodic
x[n]
SLIDE 30 Discrete-time aperiodic signal: DTFT
D iscrete-tim e signals
X(ejw)
2 4
p 2p
Continous and periodic
n
w
Tim e-dom ain Frequency-dom ain
Discrete and aperiodic
x[n]
Everything you need to know !
SLIDE 31 31
Summary of Fourier series and transforms
SLIDE 32 32
Periodicity with โperiodโ ๐ท in one domain implies discretization with โspacingโ ๐ โ ๐ท in the other domain, and vice versa.
SLIDE 33
Frequency : F (Hz)
SLIDE 34
Angular frequency: ๐ = ๐๐๐ฎ (rad/sec)
SLIDE 35
Normalized frequency: f = ๐ฎ/๐ฎ๐ (cycles/samples)
SLIDE 36 Normalized angular frequency: ๐ = ๐๐ ร ๐ฎ/๐ฎ๐ (radians x cycles/samples)
radians
SLIDE 37 Normalized angular frequency: ๐ = ๐๐ ร ๐ฎ/๐ฎ๐ (radians x cycles/samples)
radians
Low Freq. High Freq. High Freq.
SLIDE 38
Numerical computation of DTFS
Formula MATLAB function Let ๐ ๐ be periodic and ๐ = ๐ ๐ ๐ ๐ , โฏ , ๐ ๐ถ โ ๐ includes first ๐ถ sampls.
SLIDE 39
Example 1.1: use of fft and ifft
Example 1: Compute the DFTS of pulse train with ๐ด=2 and ๐ถ = ๐๐. % signal x=[1 1 1 0 0 0 0 0 1 1] % N N=length(x); % ck c=fft(x)/N x1=ifft(c)*N % plot x1 stem(x1) title('ifft(c)*N')
SLIDE 40
Numerical computation of DTFT
The computation of a finite length sequence ๐[๐] that is nonzero between 0 and ๐ถ โ ๐ at frequency ๐๐ is given by, Formula
X=freqz(x,1,om) % DTFT
MATLAB function
SLIDE 41 Example 1.2: use of freqz
Example 1.2: plot magnitude and phase spectrum of the following signal
โ10 โ5 5 10 15 20 0.5 1 n x[n] (a)
๐ ๐[๐]
SLIDE 42 Example 1.2: use of freqz
% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega
% Compute DTFT X=freqz(x,1,om); % |X| X1=abs(X); % plot magnitude spectrum figure(1) plot(om,X1,'LineWidth',2.5) xlabel('Normalized angular frequency') ylabel('Magnitude |X|')
SLIDE 43 Example 1.2: use of freqz
% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega
% Compute DTFT X=freqz(x,1,om); % |X| X1=abs(X); % plot magnitude spectrum figure(1) plot(om,X1,'LineWidth',2.5) xlabel('Normalized angular frequency') ylabel('Magnitude |X|')
SLIDE 44 Example 1.2: use of freqz
% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega
% Compute DTFT X=freqz(x,1,om); % |X| X1=abs(X); % plot magnitude spectrum figure(1) plot(om,X1,'LineWidth',2.5) xlabel('Normalized angular frequency') ylabel('Magnitude |X|')
SLIDE 45 Example 1.2: use of freqz
% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega
% Compute DTFT X=freqz(x,1,om); % |X| X1=abs(X); % plot magnitude spectrum figure(1) plot(om,X1,'LineWidth',2.5) xlabel('Normalized angular frequency') ylabel('Magnitude |X|')
SLIDE 46 Example 1.2: use of freqz
% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega
% Compute DTFT X=freqz(x,1,om); % |X| X1=abs(X); % plot magnitude spectrum figure(1) plot(om,X1,'LineWidth',2.5) xlabel('Normalized angular frequency') ylabel('Magnitude |X|')
SLIDE 47 Example 1.2: use of freqz
% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega
% Compute DTFT X=freqz(x,1,om); % phase p=angle(X); % plot phase spectrum figure(2) plot(om,p,'LineWidth',2.5) xlabel('Normalized angular frequency') ylabel(โPhase')
SLIDE 48
Example 1.3: use of freqz
Example 1.2: plot magnitude and phase spectrum of ๐ ๐ = ๐. ๐ ร ๐ญ๐ฃ๐จ๐ (๐. ๐๐) for ๐ = โ๐๐๐: ๐: ๐๐๐.
SLIDE 49 Example 1.3: use of freqz
% time t or n t=-200:1:200; % signal x=0.6*sinc(0.6.*t); % plots signal figure(1) plot(t,x,'LineWidth',2.5) title('x') % define omega
% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)
SLIDE 50 Example 1.3: use of freqz
% time t or n t=-200:1:200; % signal x=0.6*sinc(0.6.*t); % plots signal figure(1) plot(t,x,'LineWidth',2.5) title('x') % define omega
% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)
SLIDE 51 Example 1.3: use of freqz
% time t or n t=-200:1:200; % signal x=0.6*sinc(0.6.*t); % plots signal figure(1) plot(t,x,'LineWidth',2.5) title('x') % define omega
% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)
SLIDE 52 Example 1.3: use of freqz
% time t or n t=-200:1:200; % signal x=0.6*sinc(0.6.*t); % plots signal figure(1) plot(t,x,'LineWidth',2.5) title('x') % define omega
% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)
SLIDE 53 Example 1.3: use of freqz
% time t or n t=-200:1:200; % signal x=0.6*sinc(0.6.*t); % plots signal figure(1) plot(t,x,'LineWidth',2.5) title('x') % define omega
% compute DTFT X=freqz(x,1,om); % scale it by factor pi figure(2) plot(om/pi,abs(X),'LineWidth',2.5)
SLIDE 54
Example 1.4: use of freqz
Example 1.2: plot magnitude and phase spectrum of ๐ ๐ = ๐. ๐ ร ๐ญ๐ฃ๐จ๐ (๐. ๐๐) for ๐ = โ๐๐๐: ๐. ๐: ๐๐๐. You should scale freqz(x,1,om) by Ts (i.e. X=Ts* freqz(x,1,om)). More details in the future sessionsโฆ
SLIDE 55
Main application of freqz(b,a,om)
๐ฐ ๐ = ๐ช(๐) ๐ฉ(๐) = ๐ ๐ + ๐ ๐ ๐โ๐ + โฏ + ๐(๐)๐โ(๐โ๐) ๐ ๐ + ๐ ๐ ๐โ๐ + โฏ + ๐(๐)๐โ(๐โ๐)
SLIDE 56
Main application of freqz(b,a,om)
๐ฐ ๐ = ๐ช(๐) ๐ฉ(๐) = ๐ ๐ + ๐ ๐ ๐โ๐ + โฏ + ๐(๐)๐โ(๐โ๐) ๐ ๐ + ๐ ๐ ๐โ๐ + โฏ + ๐(๐)๐โ(๐โ๐) For ๐ = ๐๐๐ one can write, ๐ฐ ๐๐๐ = ๐ช(๐๐๐) ๐ฉ(๐๐๐) = ๐ ๐ + ๐ ๐ ๐โ๐๐ + โฏ + ๐(๐)๐โ๐(๐โ๐)๐ ๐ ๐ + ๐ ๐ ๐โ๐๐ + โฏ + ๐(๐)๐โ๐(๐โ๐)๐
SLIDE 57 Main application of freqz(b,a,om)
๐ฐ ๐ = ๐ช(๐) ๐ฉ(๐) = ๐ ๐ + ๐ ๐ ๐โ๐ + โฏ + ๐(๐)๐โ(๐โ๐) ๐ ๐ + ๐ ๐ ๐โ๐ + โฏ + ๐(๐)๐โ(๐โ๐) For ๐ = ๐๐๐ one can write, ๐ฐ ๐๐๐ = ๐ช(๐๐๐) ๐ฉ(๐๐๐) = ๐ ๐ + ๐ ๐ ๐โ๐๐ + โฏ + ๐(๐)๐โ๐(๐โ๐)๐ ๐ ๐ + ๐ ๐ ๐โ๐๐ + โฏ + ๐(๐)๐โ๐(๐โ๐)๐
b= [b(1),โฆ,b(n)]; % vector b numerator a= [a(1),โฆ,a(n)]; % vector a denominator
- m=linspace(-pi,pi,k); % desired frequency range
H=freqz(b,a,om); % system frequency response
SLIDE 58
From ZT to DTFT
SLIDE 59
From ZT to DTFT
SLIDE 60
From ZT to DTFT
SLIDE 61
Example 1.5: frequency response
Example 1.2: plot magnitude and phase spectrum of a system with zeros ๐๐,๐ = ยฑ๐ and ๐๐,๐ = ๐. ๐๐ยฑ๐๐/๐.
SLIDE 62 Example 1.5: frequency response
Example 1.2: plot magnitude and phase spectrum of a system with zeros ๐๐,๐ = ยฑ๐ and ๐๐,๐ = ๐. ๐๐ยฑ๐๐/๐. % zeros zer = [-1 1]; % ploes pol=0.9*exp(1i*pi*1/4*[-1 +1]); % Turn it to rational transfer function [b,a]=zp2tf(zer',pol',1); % omega
% freq. response X=freqz(b,a,om); % magnitude response scaled by pi figure(1) plot(om/pi,abs(X),'LineWidth',2.5) xlabel('Normalized frequency (\pi x rad/sample) ')
SLIDE 63 Example 1.5: frequency response
Example 1.2: plot magnitude and phase spectrum of a system with zeros ๐๐,๐ = ยฑ๐ and ๐๐,๐ = ๐. ๐๐ยฑ๐๐/๐. % zeros zer = [-1 1]; % ploes pol=0.9*exp(1i*pi*1/4*[-1 +1]); % Turn it to rational transfer function [b,a]=zp2tf(zer',pol',1); % omega
% freq. response X=freqz(b,a,om); % magnitude response scaled by pi figure(1) plot(om/pi,abs(X),'LineWidth',2.5) xlabel('Normalized frequency (\pi x rad/sample) ')
SLIDE 64 Example 1.5: frequency response
Example 1.2: plot magnitude and phase spectrum of a system with zeros ๐๐,๐ = ยฑ๐ and ๐๐,๐ = ๐. ๐๐ยฑ๐๐/๐. % zeros zer = [-1 1]; % ploes pol=0.9*exp(1i*pi*1/4*[-1 +1]); % Turn it to rational transfer function [b,a]=zp2tf(zer',pol',1); % omega
% freq. response X=freqz(b,a,om); % magnitude response scaled by pi figure(1) plot(om/pi,abs(X),'LineWidth',2.5) xlabel('Normalized frequency (\pi x rad/sample) ')
SLIDE 65 Useful links
- https://nl.mathworks.com/help/signal/ref/freqz.html
- https://nl.mathworks.com/help/signal/ref/angle.html
- https://nl.mathworks.com/help/matlab/ref/fft.html
- https://www.12000.org/my_notes/on_scaling_factor_fo
r_ftt_in_matlab/index.htm