Fourier representation of signals M ATLAB tutorial series (Part 1.1) - - PowerPoint PPT Presentation

โ–ถ
fourier representation of signals
SMART_READER_LITE
LIVE PREVIEW

Fourier representation of signals M ATLAB tutorial series (Part 1.1) - - PowerPoint PPT Presentation

Fourier representation of signals M ATLAB tutorial series (Part 1.1) Pouyan Ebrahimbabaie Laboratory for Signal and Image Exploitation (INTELSIG) Dept. of Electrical Engineering and Computer Science University of Lige Lige, Belgium Applied


slide-1
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
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
SLIDE 3

Fourier analysis is like a glass prism

Glass prism

Analysis

Beam of sunlight

Violet Blue Green Yellow Orange Red

slide-4
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
SLIDE 5

Fourier analysis in signal processing

  • Fourier analysis is the decomposition of a signal into

frequency components, that is, complex exponentials

  • r sinusoidal signals.

Original signal

slide-6
SLIDE 6

Fourier analysis in signal processing

  • Fourier analysis is the decomposition of a signal into

frequency components, that is, complex exponentials

  • r sinusoidal signals.

Sinusoidal signals Original signal

=

Joseph Fourier 1768-1830

slide-7
SLIDE 7

Motivation Question: what is our motivation to describe each signal as a sum or integral of sinusoidal signals?

slide-8
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
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
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
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
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
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
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
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

  • T0

T

slide-16
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

  • T0

T

slide-17
SLIDE 17

From CTFS to CTFT Example: consider the following signal,

slide-18
SLIDE 18

From CTFS to CTFT Example: consider the following signal,

slide-19
SLIDE 19

From CTFS to CTFT

slide-20
SLIDE 20

From CTFS to CTFT

slide-21
SLIDE 21

From CTFS to CTFT

slide-22
SLIDE 22

From CTFS to CTFT

slide-23
SLIDE 23

Continuous-time aperiodic signal: CTFT

slide-24
SLIDE 24

Continuous-time aperiodic signal: CTFT

slide-25
SLIDE 25

Continuous-time aperiodic signal: CTFT

slide-26
SLIDE 26

Discrete-time periodic signal: DTFS

Discrete -time signals

x[n]

ck

  • N

N

Discrete and periodic Discrete and periodic

n k

Time-domain Frequency-domain

  • N

N

slide-27
SLIDE 27

Discrete-time periodic signal: DTFS

Discrete -time signals

x[n]

ck

  • N

N

Discrete and periodic Discrete and periodic

n k

Time-domain Frequency-domain

  • N

N

slide-28
SLIDE 28

Discrete-time aperiodic signal: DTFT

D iscrete-tim e signals

X(ejw)

  • 4 -2

2 4

  • 2p
  • p

p 2p

Continous and periodic

n

w

Tim e-dom ain Frequency-dom ain

Discrete and aperiodic

x[n]

slide-29
SLIDE 29

Discrete-time aperiodic signal: DTFT

D iscrete-tim e signals

X(ejw)

  • 4 -2

2 4

  • 2p
  • p

p 2p

Continous and periodic

n

w

Tim e-dom ain Frequency-dom ain

Discrete and aperiodic

x[n]

slide-30
SLIDE 30

Discrete-time aperiodic signal: DTFT

D iscrete-tim e signals

X(ejw)

  • 4 -2

2 4

  • 2p
  • p

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
SLIDE 31

31

Summary of Fourier series and transforms

slide-32
SLIDE 32

32

Periodicity with โ€œperiodโ€ ๐œท in one domain implies discretization with โ€œspacingโ€ ๐Ÿ โ„ ๐œท in the other domain, and vice versa.

slide-33
SLIDE 33

Frequency : F (Hz)

slide-34
SLIDE 34

Angular frequency: ๐› = ๐Ÿ‘๐†๐‘ฎ (rad/sec)

slide-35
SLIDE 35

Normalized frequency: f = ๐‘ฎ/๐‘ฎ๐’• (cycles/samples)

slide-36
SLIDE 36

Normalized angular frequency: ๐ = ๐Ÿ‘๐† ร— ๐‘ฎ/๐‘ฎ๐’• (radians x cycles/samples)

radians

slide-37
SLIDE 37

Normalized angular frequency: ๐ = ๐Ÿ‘๐† ร— ๐‘ฎ/๐‘ฎ๐’• (radians x cycles/samples)

radians

Low Freq. High Freq. High Freq.

slide-38
SLIDE 38

Numerical computation of DTFS

Formula MATLAB function Let ๐’š ๐’ be periodic and ๐’š = ๐’š ๐Ÿ ๐’š ๐Ÿ , โ‹ฏ , ๐’š ๐‘ถ โˆ’ ๐Ÿ includes first ๐‘ถ sampls.

slide-39
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
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
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
SLIDE 42

Example 1.2: use of freqz

% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega

  • m=linspace(-pi,pi,500);

% 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
SLIDE 43

Example 1.2: use of freqz

% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega

  • m=linspace(-pi,pi,500);

% 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
SLIDE 44

Example 1.2: use of freqz

% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega

  • m=linspace(-pi,pi,500);

% 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
SLIDE 45

Example 1.2: use of freqz

% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega

  • m=linspace(-pi,pi,500);

% 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
SLIDE 46

Example 1.2: use of freqz

% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega

  • m=linspace(-pi,pi,500);

% 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
SLIDE 47

Example 1.2: use of freqz

% signal x=[1 1 1 1 1 1 1 1 1 1 1]; % define omega

  • m=linspace(-pi,pi,500);

% 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
SLIDE 48

Example 1.3: use of freqz

Example 1.2: plot magnitude and phase spectrum of ๐’š ๐’ = ๐Ÿ. ๐Ÿ• ร— ๐ญ๐ฃ๐จ๐ (๐Ÿ. ๐Ÿ•๐’) for ๐’ = โˆ’๐Ÿ‘๐Ÿ๐Ÿ: ๐Ÿ: ๐Ÿ‘๐Ÿ๐Ÿ.

slide-49
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

  • m=linspace(-pi,pi,500);

% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)

slide-50
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

  • m=linspace(-pi,pi,500);

% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)

slide-51
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

  • m=linspace(-pi,pi,500);

% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)

slide-52
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

  • m=linspace(-pi,pi,500);

% compute DTFT X=freqz(x,1,om); % plot magnitude spectrum figure(2) plot(om,abs(X),'LineWidth',2.5)

slide-53
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

  • m=linspace(-pi,pi,500);

% compute DTFT X=freqz(x,1,om); % scale it by factor pi figure(2) plot(om/pi,abs(X),'LineWidth',2.5)

slide-54
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
SLIDE 55

Main application of freqz(b,a,om)

๐‘ฐ ๐’œ = ๐‘ช(๐’œ) ๐‘ฉ(๐’œ) = ๐’„ ๐Ÿ + ๐’„ ๐Ÿ‘ ๐’œโˆ’๐Ÿ + โ‹ฏ + ๐’„(๐’)๐’œโˆ’(๐’โˆ’๐Ÿ) ๐’ƒ ๐Ÿ + ๐’ƒ ๐Ÿ‘ ๐’œโˆ’๐Ÿ + โ‹ฏ + ๐’ƒ(๐’)๐’œโˆ’(๐’โˆ’๐Ÿ)

slide-56
SLIDE 56

Main application of freqz(b,a,om)

๐‘ฐ ๐’œ = ๐‘ช(๐’œ) ๐‘ฉ(๐’œ) = ๐’„ ๐Ÿ + ๐’„ ๐Ÿ‘ ๐’œโˆ’๐Ÿ + โ‹ฏ + ๐’„(๐’)๐’œโˆ’(๐’โˆ’๐Ÿ) ๐’ƒ ๐Ÿ + ๐’ƒ ๐Ÿ‘ ๐’œโˆ’๐Ÿ + โ‹ฏ + ๐’ƒ(๐’)๐’œโˆ’(๐’โˆ’๐Ÿ) For ๐’œ = ๐’‡๐’Œ๐ one can write, ๐‘ฐ ๐’‡๐’Œ๐ = ๐‘ช(๐’‡๐’Œ๐) ๐‘ฉ(๐’‡๐’Œ๐) = ๐’„ ๐Ÿ + ๐’„ ๐Ÿ‘ ๐’‡โˆ’๐’Œ๐ + โ‹ฏ + ๐’„(๐’)๐’‡โˆ’๐’Œ(๐’โˆ’๐Ÿ)๐ ๐’ƒ ๐Ÿ + ๐’ƒ ๐Ÿ‘ ๐’‡โˆ’๐’Œ๐ + โ‹ฏ + ๐’ƒ(๐’)๐’‡โˆ’๐’Œ(๐’โˆ’๐Ÿ)๐

slide-57
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
SLIDE 58

From ZT to DTFT

slide-59
SLIDE 59

From ZT to DTFT

slide-60
SLIDE 60

From ZT to DTFT

slide-61
SLIDE 61

Example 1.5: frequency response

Example 1.2: plot magnitude and phase spectrum of a system with zeros ๐’œ๐Ÿ,๐Ÿ‘ = ยฑ๐Ÿ and ๐’’๐Ÿ,๐Ÿ‘ = ๐Ÿ. ๐Ÿ˜๐’‡ยฑ๐’Œ๐†/๐Ÿ“.

slide-62
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

  • m=linspace(-pi,pi,500);

% 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
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

  • m=linspace(-pi,pi,500);

% 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
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

  • m=linspace(-pi,pi,500);

% 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
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