0% found this document useful (0 votes)
21 views69 pages

Fourier Analysis of Signals - Students

Uploaded by

raisa.mim17
Copyright
© © All Rights Reserved
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)
21 views69 pages

Fourier Analysis of Signals - Students

Uploaded by

raisa.mim17
Copyright
© © All Rights Reserved
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/ 69

Fourier analysis of signals

Tamanna Howlader
Institute of Statistical Research and Training
University of Dhaka
Time versus frequency domain analysis

time, t Fourier frequency, f


analysis

Fourier representation of signals allows frequency-domain


representation of continuous-time signals.
• Sinusoidal and complex exponential signals
Sinusoidal signals
Sinusoidal signals
Sinusoidal signals
Exponential signals

Euler’s formula :
Exponential signals

Continuous-time complex exponential signal


Exponential signals

Definition: Harmonic family of continuous-time complex


exponential
Exponential signals

Discrete-time complex exponential model


Exponential signals

Definition: Harmonic family of discrete-time complex exponential


Continuous-time Fourier series
Fourier series
CT Fourier Series
CT Fourier Series
CT Fourier Series

The basic idea of a Fourier Series is that we can decompose a


periodic function into the sum of simpler sine and cosine curves.
CT Fourier Series

Example:
CT Fourier Series
Convergence properties of Fourier Series

Example: Saw-tooth signal

Fourier series of a saw-tooth signal:


f(t)=1+2 sin t−sin 2t+2/3 sin 3t−1/2sin 4t+2/5sin 5t+...

f(t)=1 (first term of the series): f(t)=1+2 sin t (first 2 terms of the series):
Convergence properties of Fourier Series

f(t)=1+2 sin t−sin 2t (first 3 terms of the series):

f(t)=1+2 sin t −sin 2t+2/3sin 3t (first 4 terms)


Convergence properties of Fourier Series

f(t)=1+2 sin t −sin 2t+2/3sin 3t −1/2sin 4t (first 5 terms)

f(t)=1+2 sin t −sin 2t+2/3sin 3t −1/2sin 4t+2/5sin 5t (first 6 terms)

As we add more terms to the series, it converges to a particular shape


Convergence properties of Fourier Series
Convergence properties of Fourier Series
Convergence properties of Fourier Series
Convergence properties of Fourier Series

Examples of functions
violating the
Dirichlet’s conditions
Convergence properties of Fourier Series
Convergence properties of Fourier Series
Fourier Series and frequency spectra
Fourier Series and frequency spectra

Recall: :
Fourier Series and frequency spectra
Continuous time Fourier transform
Motivation for the Fourier Transform
CT Fourier Transform
Convergence of the Fourier Transform
Convergence of the Fourier Transform
Properties of the Fourier Transform

Linearity

Convolution
Properties of the Fourier Transform
Properties of the Fourier Transform

Differentiation
Fourier Transform of periodic signals
Properties of the Fourier Transform (contd)
Properties of the Fourier Transform
Properties of the Fourier Transform
Discrete Fourier series and discrete Fourier
transform
Discrete-time Fourier series
Discrete-time Fourier series
Discrete-time Fourier series
Discrete Fourier transform
Discrete Fourier transform
Applications of Fourier analysis

• Used in cell phone network technology where digital filtering is


used to minimize noise
• Compression (mp3 and JPEG): In audio compression, take a
sound, expand its Fourier series. The series converges so fast
that taking the first few terms is enough to reproduce the original
sound. Saving the first few terms and using them to produce the
sound takes much less memory
• Image processing
• Speech analysis
• Medical e.g. PET scan, CAT scan and MRI interpretation for
sleep disorder and heart malfunction diagnosis
Application: Removing noise using Fourier Analysis

Removing noise from signals using Fourier analysis

Recall:
Fourier Transform: an integral transform

Discrete Fourier Transform (DFT) : Approximation to Fourier


integral. Maps discrete vector to another discrete vector

Fast Fourier Transform (FFT):


Special computational algorithm for DFT
Application: Removing noise using Fourier Analysis

Steps for noise removal


o Given: signal = desired signal + noise
y(t) = x(t) + e(t)
o Goal: reduce (“filter out”) as much noise as possible
o Idea : Eliminate high frequency or low amplitude components
o Approach:
- Sample signal
- Compute FFT
- Set to zero the portion of the spectrum that are noise
- Use inverse FFT (ifft) to synthesize improved signal
Application: Removing noise using Fourier Analysis

Uniform sampling

x(n) = xa (nT ) -¥ < n < ¥

x(n) = discrete time signal obtained by taking samples of


analog signal xa (T ) every T seconds
T = sampling interval
Fs = sampling rate (samples per second) or sampling
frequency (hertz)
Application: Removing noise using Fourier Analysis

Sampling principle

A signal xa(t) with bandwidth F0 can be reconstructed from its sample


values x(n)=xa(nTs) if the sampling frequency Fs=1/Ts is greater than
twice the bandwidth F0 of xa(t), i.e. Fs > 2F0

Otherwise aliasing would result in x(n). The sampling rate of 2F0 is


called the Nyquist rate.

Note: The bandwidth of a composite signal is the difference between


the highest and the lowest frequencies contained in that signal.
Application: Removing noise using Fourier Analysis

Bandwidth
Application: Removing noise using Fourier Analysis

MATLAB implementation
Simulation of analog signal

Sample xa(t) on a fine grid that has a sufficiently small time


increment to yield a smooth plot and a large enough maximum
time to show all the modes. Then

xG(M) @ xa(mΔt)

can be used as an array to simulate an analog signal, where Δt is


the grid interval such that Δt << Ts.
Application: Removing noise using Fourier Analysis
MATLAB implementation: Sampling an
analog signal
-1000 |t |
Let xa (t ) = e . The bandwidth of this signal is 2KHz.
Sample xa(t) at Fs=5000 sam/sec to obtain x1(n).

% Analog Signal
>> Dt=0.00005; t=-0.005 : Dt : 0.005; xa=exp(-
1000*abs(t));
% Discrete-time signal
>>Ts=0.0002; n=-25 : 1 : 25; x= exp(-
1000*abs(n*Ts));
>>plot(t*1000, xa); % the analog signal
>> title(‘Discrete Signal’); hold on
>> stem(n*Ts*1000, x);
>> gtext(‘Ts=0.2ms’);hold off
Application: Removing noise using Fourier Analysis
MATLAB implementation: Sampling an
analog signal
Discrete Signal
1

0.9
Ts=0.2msec
0.8

0.7

0.6
xi(n)

0.5

0.4

0.3

0.2

0.1

0
-5 -4 -3 -2 -1 0 1 2 3 4 5
t in msec.
Application: Removing noise using Fourier Analysis

Suppose x(t)= sin t


Noise model: y(t) = x(t) + e(t), e(t) ~ N(0,1)

Matlab implementation

>> dt = 0.001; % sampling rate


>> et = 6; % end of the interval
>> t = 0:dt:et; % sampling range
>> y = sin(t); % sample the signal
>> plot(t,y); % plot of noise-free signal
>> xlabel('Time (s)'); % time expressed in seconds
>> ylabel('Amplitude'); % amplitude as function of
time
>> title('Noise-free signal');
Application: Removing noise using Fourier Analysis

Noise-free signal
1

0.8

0.6

0.4

0.2
Amplitude

-0.2

-0.4

-0.6

-0.8

-1
0 1 2 3 4 5 6
Time (s)
Application: Removing noise using Fourier Analysis

• Generating noisy signal

>> noise = randn(1,size(y,2)); % random noise


>> figure; ey = y + noise; % samples with noise
>> plot(t,ey); % plot of noisy signal
>> xlabel('Time (s)'); % time expressed in seconds
>> ylabel('Amplitude'); % amplitude as function of
time
>> title('Noisy signal');
Application: Removing noise using Fourier Analysis
Noisy signal
5

1
Amplitude

-1

-2

-3

-4

-5
0 1 2 3 4 5 6
Time (s)
Application: Removing noise using Fourier Analysis

• Removing low magnitude components by thresholding:

>> eY = fft(ey); % Fourier transform of noisy signal


>> mag_eY=abs(eY);% vector of coefficients magnitudes
>> i=(mag_eY > 200); %index vector for identifying
magnitudes greater than threshold
>> fY = eY.*i; % vector of thresholded coefficients
>> ifY = ifft(fY); %inverse Fourier transform of fixed
data
Recall: Fourier transform is complex

>> cy = real(ifY); % remove imaginary parts


>> plot(t,cy); % plot of noisy signal
>> xlabel('Time (s)'); % time expressed in seconds
>> ylabel('Amplitude'); % amplitude as function of time
>> title(’Corrected signal');
Application: Removing noise using Fourier Analysis

Corrected signal
1.5

0.5
Amplitude

-0.5

-1

-1.5
0 1 2 3 4 5 6
Time (s)
Constructing magnitude spectrum using MATLAB

The frequency spectrum of a time-domain signal is two-sided.


That is, a plot of the frequency spectrum shows negative and
positive frequency components Most real-world frequency
analysis instruments show only the positive half of the frequency
spectrum because the spectrum of a real-world signal is
symmetrical about DC. Thus, the negative frequency information
is redundant. Therefore to convert from a two-sided spectrum to a
one-sided spectrum, we discard second half of the array.

Adjusting frequency resolution and graphing the spectrum


The frequency range and resolution on the x-axis of a spectrum plot
depend on the sampling rate and number of points acquired.
Constructing magnitude spectrum using MATLAB

The number of frequency points equals N/2 where N is the number


of points in the acquired time-domain signal.

The first frequency is at 0 Hz, that is DC. The last frequency is at


Fs/2 – Fs/N where Fs is the frequency at which the time-
domain signal was sampled.

The frequency lines occur at ∆f = Fs/N intervals.

The frequency range will be from 0 to Fs/2 – Fs/N. For example if


there are 1024 sample points and sampling frequency is 1.024
KHz, then ∆f = 1 Hz and the frequency will range from 0 to 511 Hz.
Constructing magnitude spectrum using MATLAB

Suppose x(t)= sin (200πt )+ 2sin(600πt)


Sample the signal for 10 secs at a sampling rate of 1kHz

Matlab implementation

>> Fs = 1000; % sampling rate


>> et = 10; % end of the interval
>> t = 0:1/Fs:et; % sampling range
>> N = length(t); % number of sampling points
>> y = sin(200*pi*t)+2*sin(600*pi*t); % sample the
signal
>> mag_y = abs(fft(y));
>> F=(0:1/N:1/2-1/N)*Fs; % frequency axis
Constructing magnitude spectrum using MATLAB

>> figure; plot(F,mag_y(1:length(F))); % plot of


magnitude spectrum
>> xlabel(‘frequency (Hz)'); %
>> ylabel(‘magnitude'); %
>> title(‘Magnitude spectrum');
Thank You

You might also like