Date post: | 03-Jun-2018 |
Category: |
Documents |
Upload: | martins-victor |
View: | 397 times |
Download: | 0 times |
of 49
8/12/2019 Signal Freq
1/49
Yao Wang
Polytechnic University, Brooklyn, NY11201
http: //eeweb.poly.edu/~yao
Frequency DomainCharacterization of Signals
8/12/2019 Signal Freq
2/49
Yao Wang, 2006 EE3414: Signal Characterization 2
Signal Representation
What is a signal
Time-domain description Waveform representation
Periodic vs. non-periodic signals
Frequency-domain description Periodic signals
Sinusoidal signals
Fourier series for periodic signals
Fourier transform for non-periodic signals
Concepts of frequency, bandwidth, filtering
Numerical calculation: FFT, spectrogram
Demo: real sounds and their spectrogram (from DSP First)
8/12/2019 Signal Freq
3/49
Yao Wang, 2006 EE3414: Signal Characterization 3
What is a signal
A variable (or multiple variables) that changes in time
Speech or audio signal: A sound amplitude that varies in time Temperature readings at different hours of a day
Stock price changes over days
Etc
More generally, a signal may vary in 2-D space and/or time A picture: the color varies in a 2-D space
A video sequence: the color varies in 2-D space and in time
Continuous vs. Discrete
The value can vary continuously or take from a discrete set The time and space can also be continuous or discrete
We will look at continuous-time signal only in this lecture
8/12/2019 Signal Freq
4/49
Yao Wang, 2006 EE3414: Signal Characterization 4
Waveform Representation
Waveform representation
Plot of the variable value (sound amplitude, temperature
reading, stock price) vs. time
Mathematical representation: s(t)
8/12/2019 Signal Freq
5/49
Yao Wang, 2006 EE3414: Signal Characterization 5
Sample Speech Waveform
0 2000 4000 6000 8000 10000 12000 14000 16000-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
2000 2200 2400 2600 2800 3000-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Entire waveform
[y,fs]=wavread('morning.wav'); sound(y,fs); figure; plot(y); x=y(10000:25000);plot(x);
Blown-up of a section.
figure; plot(x); axis([2000,3000,-0.1,0.08]);
Signal within each short time interval is periodic
Period depends on the vowel being spoken
8/12/2019 Signal Freq
6/49
Yao Wang, 2006 EE3414: Signal Characterization 6
Sample Music Waveform
Entire waveform
[y,fs]=wavread(sc01_L.wav'); sound(y,fs); figure; plot(y);
Blown-up of a section
v=axis; axis([1.1e4,1.2e4,-.2,.2])
Music typically has more periodic structure than speech
Structure depends on the note being played
8/12/2019 Signal Freq
7/49
Yao Wang, 2006 EE3414: Signal Characterization 7
Sinusoidal Signals
Sinusoidal signals are important because they can be used to
synthesize any signal An arbitrary signal can be expressed as a sum of many sinusoidalsignals with different frequencies, amplitudes and phases
Music notes are essentially sinusoids at different frequencies
shift)(timePhase:Amplitude:
period:/1
cond)(cycles/se
frequency:
)2cos()(
00
0
0
A
fT
f
tfAts
=
+=
-1.5 -1 -0.5 0 0.5 1 1.5-2.5
-2
-1.5
-1
-0.5
0
0.5
11.5
2
2.5
8/12/2019 Signal Freq
8/49
Yao Wang, 2006 EE3414: Signal Characterization 8
What is frequency of an arbitrary
signal?
Sinusoidal signals have a distinct (unique) frequency
An arbitrary signal does not have a unique frequency, but canbe decomposed into many sinusoidal signals with different
frequencies, each with different magnitude and phase
The spectrum of a signal refers to the plot of the magnitudes
and phases of different frequency components The bandwidth of a signal is the spread of the frequency
components with significant energy existing in a signal
Fourier series and Fourier transform are ways to find spectrums
for periodic and aperiodic signals, respectively
8/12/2019 Signal Freq
9/49
Yao Wang, 2006 EE3414: Signal Characterization 9
Approximation of Periodic Signals
by Sum of Sinusoids
-1.5 -1 -0.5 0 0.5 1 1.5
-1
-0.5
0
0.5
1
2 sinusoids: 1st and 3d harmonics
4 sinusoids: 1,3,5,7 harmonicsView note for matlab code
With many more sinusoids with appropriate magnitude, we will get the square wave exactly
)2cos()(0
0
=
=
k
k tkfAts
8/12/2019 Signal Freq
10/49
Yao Wang, 2006 EE3414: Signal Characterization 10
1 3 5 7 9 11 13 150
0.2
0.4
0.6
0.8
1
1.2
1.4
k,fk=f
0*k
Amplitude
Magnitude Spectrum for Square Wave
Line Spectrum of Square Wave
=
==
,...4,2,00
,...5,3,14
k
kkAk
Each line corresponds to oneharmonic frequency. The line
magnitude (height) indicates
the contribution of that
frequency to the signal.
The line magnitude drops
exponentially, which is not
very fast. The very sharp
transition in square waves
calls for very high frequency
sinusoids to synthesize.
8/12/2019 Signal Freq
11/49
Yao Wang, 2006 EE3414: Signal Characterization 11
Period Signal
Period T: The minimum interval on which a signal
repeats Sketch on board
Fundamental frequency: f0 =1/T
Harmonic frequencies: kf0
8/12/2019 Signal Freq
12/49
Yao Wang, 2006 EE3414: Signal Characterization 12
Approximation of Periodic Signals by
Sinusoids
Any periodic signal can be approximated by a sum of
many sinusoids at harmonic frequencies of the signal(kf0 ) with appropriate amplitude and phase.
The more harmonic components are added, the more
accurate the approximation becomes. Instead of using sinusoidal signals, mathematically,
we can use the complex exponential functions with
both positive and negative harmonic frequencies
8/12/2019 Signal Freq
13/49
Yao Wang, 2006 EE3414: Signal Characterization 13
Complex Exponential Signals
Complex number:
Complex exponential signal
Euler formula
)2sin()2cos()2exp()( 000 +++== tfAjtfAtfjAts
)sin(2)exp()exp(
)cos(2)exp()exp(
tjtjtj
ttjtj
=
=+
ImResincos)exp( jAjAjAA +=+==
8/12/2019 Signal Freq
14/49
Yao Wang, 2006 EE3414: Signal Characterization 14
Fourier Series Representation of
Periodic Signals
numbercomplexageneralinis
,...2,1,0;)2exp()(1
:)transform(forwardanalysisseriesFourier
complex)andrealbothforsided,(double)2exp(
only)signalrealforsided,single()2cos()(
:)transform(inverseSynthesisSeriesFourier
0
00
0
0
100
k
T
k
k
k
k
kk
S
kdttkfjtsT
S
tkfjS
tkfAAts
==
=
++=
=
=
For real signals, Sk=S*-k|Sk|=|S-k| (Symmetric spectrum)
8/12/2019 Signal Freq
15/49
Yao Wang, 2006 EE3414: Signal Characterization 15
Fourier Series Representation of
Square Wave
Applying the Fourier series analysis formula to the
square wave, we get
Do the derivation on the board
=
==
,...4,2,00
,...5,3,12
k
kkjSk
8/12/2019 Signal Freq
16/49
Yao Wang, 2006 EE3414: Signal Characterization 16
1 3 5 7 9 11 13 150
0.2
0.4
0.6
0.8
1
1.2
1.4
k,fk=f
0*k
Amplitude
Magnitude Spectrum for Square Wave
Line Spectrum of Square Wave
=
==
,...4,2,00
,...5,3,14
k
kkAk
Only the positive frequencyside is drawn on the left
(single sided spectrum), with
twice the magnitude of the
double sided spectrum.
8/12/2019 Signal Freq
17/49
Yao Wang, 2006 EE3414: Signal Characterization 17
Fourier Transform for Non-Periodic
Signals
sumofinsteadintegral
harmonicsofnumbereuncountabl0signalAperiodic 00
== fT
=
=
dtftjts
dfftjfSts
)2exp()(S(f)
:)transform(forwardanalysisFourier
)2exp()()(
:)transform(inversesynthesisFourier
For real signals, |S(f)| =|S(-f)| (Symmetric magnitude spectrum)
8/12/2019 Signal Freq
18/49
Yao Wang, 2006 EE3414: Signal Characterization 18
Pulse Function: Time Domain
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 10
0.2
0.4
0.6
0.8
1
1.2
t
s(t)
A Rectangular Pulse Function
T
Derive Fourier transform on the board
8/12/2019 Signal Freq
19/49
Yao Wang, 2006 EE3414: Signal Characterization 19
Pulse Function: Spectrum
-10 -8 -6 -4 -2 0 2 4 6 8 10-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
f
|S
(f)|
Magnitude Spectrum of Rectangular Pulse
)sinc()sin(
)(
otherwise0
2/2/1)( TfT
Tf
TfTfS
TtTts ==
8/12/2019 Signal Freq
20/49
Yao Wang, 2006 EE3414: Signal Characterization 20
Exponential Decay: Time Domain
222 4
1)(;
2
1)(
otherwise0
0)exp()(
ffS
fjfS
ttts
+
=+
=
>
=
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
t
s
(t)
s(t)=exp(-t), t>0); =1
8/12/2019 Signal Freq
21/49
Yao Wang, 2006 EE3414: Signal Characterization 21
Exponential Decay: Spectrum
-10 -8 -6 -4 -2 0 2 4 6 8 100
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
f
|S(f)|
S(f)=1/(+j 2f),=1
222
4
1)(;
2
1)(
otherwise0
0)exp()(
f
fSfj
fStt
ts
+
=+
=
>
=
The FT magnitude drops
much faster than for the
pulse function. This is
because the exponential
decay function does not
has sharp transition.
8/12/2019 Signal Freq
22/49
Yao Wang, 2006 EE3414: Signal Characterization 22
-10 -8 -6 -4 -2 0 2 4 6 8 100
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
(Effective) Bandwidth
fmin (fma): lowest
(highest)frequency where
the FT magnitude
is above a
threshold
Bandwidth:B=fmax-fmin
The threshold is often
chosen with respect to
the peak magnitude,expressed in dB
dB=10 log10(ratio)
10 dB below peak =
1/10 of the peak value
3 dB below=1/2 of the
peakfmin
B
fmax
8/12/2019 Signal Freq
23/49
Yao Wang, 2006 EE3414: Signal Characterization 23
More on Bandwidth
Bandwidth of a signal is a critical feature when
dealing with the transmission of this signal A communication channel usually operates only at
certain frequency range (called channel bandwidth)
The signal will be severely attenuated if it contains
frequencies outside the range of the channel bandwidth
To carry a signal in a channel, the signal needed to be
modulated from its baseband to the channel bandwidth
Multiple narrowband signals may be multiplexed to use a
single wideband channel
8/12/2019 Signal Freq
24/49
Yao Wang, 2006 EE3414: Signal Characterization 24
How to Observe Frequency Content
from Waveforms?
A constant -> only zero frequency component (DC compoent)
A sinusoid -> Contain only a single frequency component Periodic signals -> Contain the fundamental frequency and
harmonics -> Line spectrum
Slowly varying -> contain low frequency only
Fast varying -> contain very high frequency Sharp transition -> contain from low to high frequency
Music: contain both slowly varying and fast varying components,
wide bandwidth
Highest frequency estimation? Find the shortest interval between peak and valleys
Go through examples on the board
8/12/2019 Signal Freq
25/49
Yao Wang, 2006 EE3414: Signal Characterization 25
2450 2460 2470 2480 2490 2500 2510 2520 2530 2540 2550-0.02
-0.01
0
0.01
0.02
0.03
0.04Blown-Up of the Signal
Estimation of Maximum Frequency
Time index
S(t)
8/12/2019 Signal Freq
26/49
Yao Wang, 2006 EE3414: Signal Characterization 26
Numerical Calculation of FT
The original signal is digitized, and then a Fast
Fourier Transform (FFT) algorithm is applied, whichyields samples of the FT at equally spaced intervals.
For a signal that is very long, e.g. a speech signal or
a music piece, spectrogram is used.
Fourier transforms over successive overlapping short
intervals
8/12/2019 Signal Freq
27/49
Yao Wang, 2006 EE3414: Signal Characterization 27
2000 2200 2400 2600 2800 3000-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Spectrogram
FFT
FFT FFTFFT FFT
FFT
t
S(t)
8/12/2019 Signal Freq
28/49
Yao Wang, 2006 EE3414: Signal Characterization 28
Sample Speech Waveform
0 2000 4000 6000 8000 10000 12000 14000 16000-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
2000 2200 2400 2600 2800 3000-0.1
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
Entire waveform Blown-up of a section.
Signal within each short time interval is periodic. The period T is called pitch.
The pitch depends on the vowel being spoken, changes in time. T~70 samples in this ex.
f0=1/T is the fundamental frequency (also known as formant frequency). f0=1/70fs=315 Hz.k*f0 (k=integers) are the harmonic frequencies.
(click to hear the sound)
T
8/12/2019 Signal Freq
29/49
Yao Wang, 2006 EE3414: Signal Characterization 29
Sample Speech Spectrogram
0 2000 4000 6000 8000 10000 12000-60
-55
-50
-45
-40
-35
-30
-25
-20
-15
Frequency
PowerSpectrumMagnitude(dB
)
Power Spectrum
fs=22,050Hz
figure; psd(x,256,fs);
figure; specgram(x,256,fs);
Time
Frequency
Spectrogram
0 1000 2000 3000 4000 5000 6000 70000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
GOOD MOR NING
Signal power drops sharply at about 4KHz Line spectra at multiple of f0,
maximum frequency about 4 KHz
What determines the maximum freq?
f0
f0
8/12/2019 Signal Freq
30/49
Yao Wang, 2006 EE3414: Signal Characterization 30
Another Sample Speech Waveform
Entire waveform Blown-up of a section.
In the course of a December tour in Yorkshire
8/12/2019 Signal Freq
31/49
Yao Wang, 2006 EE3414: Signal Characterization 31
Speech Spectrogram
figure; psd(x,256,fs);
figure; specgram(x,256,fs);
Signal power drops sharply at about 4KHz Line spectra at multiple of f0,
maximum frequency about 4 KHz
8/12/2019 Signal Freq
32/49
Yao Wang, 2006 EE3414: Signal Characterization 32
Sample Music Waveform
Entire waveform
[y,fs]=wavread(sc01_L.wav'); sound(y,fs); figure; plot(y);
Blown-up of a section
v=axis; axis([1.1e4,1.2e4,-.2,.2])
Music typically has more periodic structure than speech
Structure depends on the note being played
8/12/2019 Signal Freq
33/49
Yao Wang, 2006 EE3414: Signal Characterization 33
Sample Music Spectrogram
figure; psd(y,256,fs); figure; specgram(y,256,fs);
Signal power drops gradually in the entire
frequency rangeLine spectra are more stationary,
Frequencies above 4 KHz, more than
20KHz in this ex.
8/12/2019 Signal Freq
34/49
Yao Wang, 2006 EE3414: Signal Characterization 34
Summary of Characteristics
of Speech & Music
Typical speech and music waveforms are semi-periodic
The fundamental period is called pitch period The inverse of the pitch period is the fundamental frequency (f0)
Spectral content
Within each short segment, a speech or music signal can be
decomposed into a pure sinusoidal component with frequency f0,
and additional harmonic components with frequencies that are
multiples of f0.
The maximum frequency is usually several multiples of the
fundamental frequency
Speech has a frequency span up to 4 KHz Audio has a much wider spectrum, up to 22KHz
8/12/2019 Signal Freq
35/49
Yao Wang, 2006 EE3414: Signal Characterization 35
Demo
Demo in DSP First, Chapter 3, Sounds and
Spectrograms Look at the waveform and spectrogram of sample signals,
while listening to the actual sound
Simple sounds
Real sounds
8/12/2019 Signal Freq
36/49
Yao Wang, 2006 EE3414: Signal Characterization 36
Advantage of Frequency Domain
Representation
Clearly shows the frequency composition of the
signal One can change the magnitude of any frequency
component arbitrarily by a filtering operation Lowpass -> smoothing, noise removal
Highpass -> edge/transition detection High emphasis -> edge enhancement
One can also shift the central frequency bymodulation
A core technique for communication, which uses modulationto multiplex many signals into a single composite signal, tobe carried over the same physical medium.
8/12/2019 Signal Freq
37/49
Yao Wang, 2006 EE3414: Signal Characterization 37
Typical Filters
Lowpass -> smoothing, noise removal
Highpass -> edge/transition detection Bandpass -> Retain only a certain frequency range
0 f
H(f)
0 f
H(f)
0 f
H(f)
Low-pass Band-passHigh-pass
8/12/2019 Signal Freq
38/49
Yao Wang, 2006 EE3414: Signal Characterization 38
-10 -8 -6 -4 -2 0 2 4 6 8 10-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
f
|S(f)|
Magnitude Spectrum of Rectangular Pulse
Low Pass Filtering
(Remove high freq, make signal smoother)
Filtering is done by a
simple multiplification:
Y(f)= X(f) H(f)
H(f) is designed to
magnify or reduce the
magnitude (and
possibly changephase) of the original
signal at different
frequencies.
A pulse signal after
low pass filtering (left)will have rounded
corners.
Ideal
lowpass
filter
Spectrum of the pulse signal
8/12/2019 Signal Freq
39/49
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1-0.2
0
0.2
0.4
0.6
0.8
1
1.2The original pulse function and its low-passed versions
original
averaging over 11 samplesfilter=fir1(10,0.25)
t
S(t)
8/12/2019 Signal Freq
40/49
Yao Wang, 2006 EE3414: Signal Characterization 40
1 2 3 4 5 6 7 8 9 10 11-0.05
0
0.05
0.1
0.15
0.2
0.25
0.3Impulse Response of the Filters
averaging over 11 samples
fir1(10,0.25)
t
h(t)
8/12/2019 Signal Freq
41/49
Yao Wang, 2006 EE3414: Signal Characterization 41
Frequency Response of the Filters
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-80
-60
-40
-20
0
Normalized Angular Frequency (rads/sample)
Magnitude(dB
)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-200
-100
0
100
Normalized Angular Frequency (rads/sample)
Phase
(degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-150
-100
-50
0
Normalized Angular Frequency (rads/sample)
Magnitude
(dB)
0
Averaging
fir11(10,0.25)
Hi h P Filt i
8/12/2019 Signal Freq
42/49
Yao Wang, 2006 EE3414: Signal Characterization 42
High Pass Filtering
(remove low freq, detect edges)
-10 -8 -6 -4 -2 0 2 4 6 8 10-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
f
|S(f)|
Magnitude Spectrum of Rectangular Pulse
Ideal
high-pass
filter
Spectrum of the pulse signal
8/12/2019 Signal Freq
43/49
Yao Wang, 2006 EE3414: Signal Characterization 43
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
The original pulse function and its high-passed version
original
high-pass filtered
t
S(t)
8/12/2019 Signal Freq
44/49
Yao Wang, 2006 EE3414: Signal Characterization 44
The High Pass Filter
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100
-80
-60
-40
-20
0
Normalized Angular Frequency (rads/sample)
Magnitude(dB)
400
1 2 3 4 5 6 7 8 9 10 11-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
fir1(10,0.5,high);
Impulse response:
Current sample
neighboring samples
Frequency
response
t
h(t)
Filt i i T l D i
8/12/2019 Signal Freq
45/49
Yao Wang, 2006 EE3414: Signal Characterization 45
Filtering in Temporal Domain
(Convolution)
Convolution theorem
Interpretation of convolution operation replacing each pixel by a weighted sum of its neighbors
Low-pass: the weights sum = weighted average
High-pass: the weighted sum = left neighbors rightneighbors
=
dhtxthtx
thtxfHfX
)()()(*)(
)(*)()()(
8/12/2019 Signal Freq
46/49
Yao Wang, 2006 EE3414: Signal Characterization 46
Implementation of Filtering
Frequency Domain
FT -> Filtering by multiplication with H(f) -> Inverse FT Time Domain
Convolution using a filter h(t) (inverse FT of H(f))
You should understand how to perform filtering infrequency domain, given a filter specified infrequency domain
Should know the function of the filter given H(f)
Computation of convolution is not required for thislecture
Filter design is not required.
8/12/2019 Signal Freq
47/49
Yao Wang, 2006 EE3414: Signal Characterization 47
What Should You Know (I)
Sinusoid signals:
Can determine the period, frequency, magnitude and phase of a
sinusoid signal from a given formula or plot
Fourier series for periodic signals
Understand the meaning of Fourier series representation
Can calculate the Fourier series coefficients for simple signals (only
require double sided) Can sketch the line spectrum from the Fourier series coefficients
Fourier transform for non-periodic signals
Understand the meaning of the inverse Fourier transform
Can calculate the Fourier transform for simple signals
Can sketch the spectrum
Can determine the bandwidth of the signal from its spectrum
Know how to interpret a spectrogram plot
8/12/2019 Signal Freq
48/49
Yao Wang, 2006 EE3414: Signal Characterization 48
What Should You Know (II)
Speech and music signals
Typical bandwidth for both
Different patterns in the spectrogram
Understand the connection between music notes and sinusoidal
signals
Filtering concept
Know how to apply filtering in the frequency domain
Can interpret the function of a filter based on its frequency
response
Lowpass -> smoothing, noise removal
Highpass -> edge detection, differentiator Bandpass -> retain certain frequency band, useful for demodulation
8/12/2019 Signal Freq
49/49
Yao Wang, 2006 EE3414: Signal Characterization 49
References
Oppenheim and Wilsky, Signals and Systems, Sec. 4.2-4.3
(Fourier series and Fourier transform)
McClellan, Schafer and Yoder, DSP First, Sec. 2.2,2.3,2.5
(review of sinusoidal signals, complex number, complex
exponentials)