pds proiect1 engleza v2 · 2019-03-11 · digital signal processing homework 1 discrete fourier...
Post on 21-Jun-2020
3 Views
Preview:
TRANSCRIPT
Digital signal processing Homework 1
1. DISCRETE-TIME SIGNALS A discrete signal results from the sampling of a continuous signal using a sampling
period of time denoted Ts. The samples stored in the vector that represents the discrete signal
are the amplitude values of the continuous signal taken at multiples of the sampling period 𝑛 ∙𝑇 , 𝑛 ∈ ℕ
( ) ( )c ss n s nT
For example, for a sinusoidal signal of frequency F0
0 0( ) sin(2 )cs t A F t
the sampled signal is:
00 0 0( ) sin(2 ) sin 2s
s
Fs n A F n T A n
F
By denoting the normalized frequency 00
Ff
Fs , respectively the normalized angular
frequency 00 02 2
s
Ff
F results in:
0 0 0 0( ) sin(2 ) sins n A f n A n
t
A
-A
( )ax t
nA
-A
0 1 2 3 4 5 10
( )x n
Ts 2Ts…………nTs
Digital signal processing Homework 1
Discrete Fourier Transform
The Discrete Time Fourier Transform (DTFT) of a sequence ( )x n is defined by:
( ) ( )j j n
n
X e x n e
(2.8)
where is the normalized angular frequency 2S
F
F ,
- F is the un-normalized frequency (measured in Hz), - FS is the sampling frequency.
Also, the normalized frequency is: S
Ff
F .
The function )( jeX is periodical of period 2 , so it is sufficient to know the
behavior in the interval ),[ (base interval). Because this function is defined over , a
continuous variable which can take an infinite number of values, it is not possible an implementation on a computing machine.
In order to achieve, however, a frequency analysis, it is used the Discrete Fourier
Transform (DFT), computed by replacing over interval )2,0[ into N uniformly distributed
points:
2k
k
N , cu 1,,1,0 Nk .
Therefore, the Discrete Fourier Transform of a sequence ( )x n is defined by relation:
21
0
( ) ( )N j kn
N
n
X k x n e
cu 1,,1,0 Nk (2.9)
The figure below shows the spectrum of a discrete-time signal representation based on the normalized angular frequency or normalized frequency and the correspondence with analog frequency. We also notice the correspondence between the DFT spectral components of index k and the spectrum represented in normalized angular frequency.
Digital signal processing Homework 1
Short-term Fourier analysis effect
The DFT is computed over a finite number of samples, N. This process is equivalent to the multiplication of an infinite-length signal with a rectangular window of amplitude 1 and length N. As an example, for a discrete sine wave:
N
0sinx n A n
n
( )u n u n N
-Ωmax 0 Ωmax
-FS/2 -Fmax 0 Fmax FS/2 FS
aX
2S
max2S Ω[rad/s]
F[Hz]
-π -ωmax 0 ωmax π 2π
-0.5 -fmax 0 fmax 0.5 1
jX e
f
SF
S
Ff
F
0 123 N/2 N-1
X k
k
2k
k
N 0,..., 1k N
2S
Digital signal processing Homework 1
The multiplication in discrete-time corresponds in the frequency domain to the convolution between the infinite-signal spectrum and the spectrum of the rectangular window. This frequency effect is called spectral leakage.
In order to obtain the DFT, the normalized pulsation is sampled over the interval )2,0[ in
N points, so it becomes 2k
k
N . Through this sampling, if the center of the spectrum lobe
corresponds to a non-fractional value k and the number of points for DFT computing is equal to the window length, then the discrete spectrum will have a single spectral component
corresponding to 0 while the rest of the discrete components will be equal to 0, since they
correspond to annulment points in the rectangular window spectrum.
-π -ω0 0 ω
0 π 2π-ω
0 2π 2π+ω
0
jX e
ω
jDW e
0 π 2π 2
N
ω
-π -ω0 0 ω
0 π 2π-ω
0 2π
j jDX e W e
ω
0 1 2 3 4 5 6 7 8 9 10 11 k
X k
0 ω0 π 2π-ω
0 2π
2
N
ω
Digital signal processing Homework 1
If 0 does not correspond to an integral k for 2k
k
N then the sampling process
will produce a spectrum with the leakage effect.
Tema de casă:
Fiecare student are de rezolvat problema cu numărul trecut în tabelul următor. Tema trebuie realizată individual. Pentru teme copiate se anulează punctajul alocat temei. Pentru a redacta tema se va crea un document Word în care se copiază listingurile
programelor şi figurile. Tot in documentul Word se vor scrie explicațiile cerute. Pentru a copia graficele se foloseşte “Copy Figure” din meniul „Edit” al ferestrelor Matlab
Figure. Se dă apoi “Paste” în Word şi apare graficul. Se pot seta opţiunile pentru copierea figurilor în meniul “Copy Options”.
Tema se va salva într-un fișier cu numele 43gs_Nume_Prenume (unde ‘gs’ e grupa şi seria).
Tema se încarcă pe platforma http://ham.elcom.pub.ro/psc. Accesul pe platforma se face cu user: pds parola: SC140. Apoi fiecare student trebuie să-și înregistreze utilizator nou.
Tema trebuie predată înainte de 15.03.2019 ora 22:00. După acest termen tema respectivă nu se mai poate încărca pe platformă și nu se mai punctează.
0 1 2 3 4 5 6 7 8 9 10 11
k
X k
0 ω0 π 2π-ω
0 2π
2
N
Digital signal processing Homework 1
Nume Grupa Exercitiul
ARICIŞTEANU C. Tiberiu‐Mihail 431F 1
BERCEA Ș. Alin‐Ionuţ 431F 2
CAZAN M. Andrei 431F 3
COVOR A.E. Alexandra 431F 4
CRĂCIUN M.M. Ștefan‐Viorel 431F 5
DUMITRESCU M. Andrei 431F 6
FRĂTIȘTEANU S.T. Radu 431F 7
GURIŢĂ I. Ionuţ‐Alexandru 431F 8
HASNAŞ C.D. Matei‐Vladimir 431F 9
IONIŢĂ I.S. Mihnea 431F 10
JUGURICĂ B. Iani‐Dan‐Ion 431F 11
LUPU C.M. Florin‐Cristian 431F 12
MANEA S.I. Mihnea 431F 13
MĂRĂCINARU G.L. Cătălina‐Mirela 431F 14
MITROI Al. Răzvan‐Marian 431F 1
ONUŢU S. Gabriela 431F 2
POPA C.C. Nicolae‐Adrian 431F 3
POPESCU C. Alexandru‐Eugen 431F 4
RISTEA P. Ciprian 431F 5
SANDU Ș.M. Marian‐Gabriel 431F 6
SOCEA G. Vlad‐Ștefan 431F 7
STOIAN F. Cristian‐Andrei 431F 8
TĂNASE Al.D. Valentin Alexandru 431F 9
UBLEA V.C. Vlad 431F 10
VASILESCU R.V. Andrei 431F 11
VIŞINESCU F. Andreea 431F 12
ATARCICOV C. Robert‐Alexandru 432F 13
BERNEA V. Daniel‐Sorin 432F 14
CIOVICĂ I. Emil‐Daniel 432F 1
COSTEA F. Alexandru‐Mădălin 432F 2
DĂLVARU I. Ciprian‐Virgiliu 432F 3
DIACONESCU C.C. Cosmin‐Ionuţ 432F 4
DOBRE M. Liviu 432F 5
DUMITRAŞCU D. Tudor‐Andrei 432F 6
FLORESCU M.V.A. Mihai‐ Alexandru 432F 7
ILIE P.S. Carmen‐Raluca 432F 8
ION F. Alexandru‐Andrei 432F 9
PARAHATGELDIYEV Serdar 432F 10
POPA D. Larisa 432F 11
SIELECKI Al.M. Bogdan‐Radu‐Silviu 432F 12
ABDUL RAHMAN Ahmad 431G 13
ACATRINEI S. George‐Bogdan 431G 14
Digital signal processing Homework 1
Nume Grupa Exercitiul
BADEA I. Simona‐Mădălina 431G 1
BĂNICĂ P. Elena‐Mădălina 431G 2
BREAZU Gh. Dan 431G 3
CONSTANTINESCU N. Andreea‐Elena 431G 4
COSTEA F. Mihai‐Costin 431G 5
CROITORU S. Gabriela‐Diana 431G 6
DINCĂ D.O.B. Ana‐Maria 431G 7
DINU N. Sorin‐Mihai 431G 8
DÎRLĂU M. Andrei 431G 9
DOBRE I.C. Bogdan‐Nicuşor 431G 10
DRĂGUŞIN A.I. Rareş‐Ioel 431G 11
GAVRILĂ V. Raluca 431G 12
GRIGORESCU Gh. Florentin‐Liviu 431G 13
HAITĂ N. Ştefan‐Andrei 431G 14
HINTZ A.M. Theodor 431G 1
ILIE C.P. Elena‐Adriana 431G 2
JARCĂ D. Maria ‐Mădălina 431G 3
KASSAS Ahmad‐Fadel 431G 4
LĂPĂDAT M.L. Andreea‐Denisa 431G 5
NEAGU E.G. George‐Cristian 431G 6
NETEJORU M.G. Bogdan‐Mihai 431G 7
OICHEA D.I. Adrian‐Ionuţ 431G 8
PANAITESCU F. Alexandru 431G 9
PĂUNESCU M. Florian‐Gabriel 431G 10
SALEH Chakib 431G 11
ŞERBĂNESCU T. Valentin‐Adrian 431G 12
TIMOCE V. Costin‐Gabriel 431G 13
TUŢĂ S.F. Florin‐Marian 431G 14
VÂLCU F. Adrian‐Florian 431G 1
VOINEA F. Eduard‐Florin 431G 2
BĂDULĂ V. Eduard ‐ Marian 432G 3
CORLAN Al. Alexandru‐Ionuţ 432G 4
ENAYATI W. Sheida‐Taina 432G 5
GURAN I.L. Ion‐Eduard 432G 6
ILIE V.M. Dragoş‐Gabriel 432G 7
ION S.D. Cristian‐Eduard 432G 8
KASHMOOLA Mohammed Faez Abdulraheem 432G 9
LUNGU Ș. Raluca‐Ştefania 432G 10
MĂRUNŢIŞ T.S. Adina‐Maria 432G 11
MOHAMAD KUSAI Ramadan 432G 12
PAŞTEA V. Vasilica‐Denisa 432G 13
PLATON A. Alexandra‐Cristina 432G 14
POPESCU S. Ilie‐Bogdan 432G 1
POŞCHINĂ I.I. Andreea 432G 2
Digital signal processing Homework 1
Nume Grupa Exercitiul
RACHID Ali 432G 3
TRUŞCĂ C.G. Petre‐Cristian 432G 4
VĂDINEANU E.S. Andrei‐Alexandru 432G 5
GHEORGHE Andrei 441F 6
GĂLBENUȘE Fabian 441F 7
STAN Livia 441F 8
ȘERBAN Mihnea 441F 9
DRĂGUȚANU Andrei 442F 10
IANCU Ioana 441G 11
PAIUC Danie Nicolae 441G 12
BRAGĂ Ion Răducu 442G 13
DUȚAN Andrei 442G 14
AYMYRAT AYYDOU 1
MELEYEVV BEGMYRAT 2
ABDULRAHMAN AHMAD 3
ZARZAR ABDUL KAREM 4
GONÇALO MOURA 5
FEDERICO LOZANO CUADRA 6
SĂVOIU Mihnea 441F 7
Common requirements for all exercises. All the plots should have titles and axes labels. a)
Represent graphically with the stem function (the time axis according to n) the discrete signal x(n).
o Determine: the total number of samples L for x(n), the number of N samples in a period T, how many k periods are included in the TMAX acquisition time.
Represent graphically with the plot function (the time axis in milliseconds) the analog signal x (t) reverted by analog digital conversion from the discreet signal.
b)
Represent the spectrum of amplitude and phase in normalized frequencies. Determine on the graph the normalized frequency f0 corresponding to the fundamental frequency F0 and the normalized frequencies corresponding to the harmonics.
Represent the amplitude spectrum | X (k) | depending on the TFD index k. Determine the
k0 index corresponding to the fundamental frequency F0. What relationship exists between the standard frequency f0 and k0? But between k0 and the number of k periods obtained at point a)? Explain.
Represent the amplitude spectrum in un-normalized frequencies F[Hz]. Determine on the graph the amplitudes of the spectral components corresponding to the continuous component, the fundamental F0 and the harmonics. At what frequencies do harmonic components appear? What is the relationship between the amplitude A of the signal and the amplitudes measured on the graph?
Digital signal processing Homework 1
EXERCISE 1 Let the analog signal xa(t) in the figure with the following parameters: - Frequency F0 = 400 Hz, - amplitude A = 2, - acquisition time TMAX=50ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with sampling frequency Fs = 8 kHz. Note: You can use the square function. b) Calculate the DFT of the signal x (n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 256 and for NDFT = 512. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the duty factor of the rectangular signal and the signal energy using discrete signal samples x(n). Call the function in the main program and display the results. EXERCISE 2 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0 = 250 Hz - amplitude A = 2.5 - acquisition time TMAX =40ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with sampling frequency Fs = 12 kHz. Note: You can use the square function. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 256 and for NDFT = 512. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates zero-cross rate and the signal energy using the discrete signal samples x(n). Call the function in the main program and display the results. EXERCISE 3 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=300 Hz - A = 4 - acquisition time TMAX= 50ms
0
A
T TMAX
t[ms]
xa(t)
T/4
0
A
T TMAX
t[ms]
xa(t)
3/4T
-A
0
A
T TMAX
t[ms]
xa(t)
T/2
A/4
Digital signal processing Homework 1
a) Generate the discrete signal x(n) obtained by sampling xa(t) with sampling frequency Fs=16 kHz. Note: You can use the square function. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the DC component (mean value) using the discrete signal samples x(n) and returns the calculated mean value and the signal without the continuous component. Call the function in the main program and plot the signal without the continuous component. EXERCISE 4 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=600 Hz - amplitude A=2.5 - acquisition time TMAX=60 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with sampling frequency Fs=12 kHz. Note: You can use the sawtooth function. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the zero-cross rate and the signal energy, using the discrete signal samples x(n). Call the function in the main program and display the results. EXERCISE 5 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=500 Hz - A=3 - acquisition time TMAX= 80ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with sampling frequency Fs=12 kHz. Note: You can use the sawtooth function. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the derivative with finite differences
( ) ( 1) ( 1) / 2d n x n x n using the discrete signal samples x(n). Call the function in the
main program and plot on the same figure (two subplots) the initial signal and the derived signal.
0
A
T TMAX
t[ms]
xa(t)
T/2
-A
0
A
T TMAX
t[ms]
xa(t)
T/2
Digital signal processing Homework 1
EXERCISE 6 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=200 Hz - A=2 - acquisition time TMAX=60 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with sampling frequency Fs=8 kHz. Note: You can use the sawtooth function. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 256 and for NDFT = 512. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the derivative with finite differences
( ) ( 1) ( 1) / 2d n x n x n using the discrete signal samples x(n). Call the function in the
main program and plot on the same figure (two subplots) the initial signal and the derived signal. EXERCISE 7 Let the analog signal xa (t) in the figure (half-wave rectified sinusoidal signal) with the following parameters: - Frequency F0=750 Hz - A=5 - acquisition time TMAX=40 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with the sampling frequency Fs=10 kHz. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 256 and for NDFT = 512. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the DC component (mean value) using the discrete signal samples x(n) and returns the calculated mean value and the signal without the continuous component. Call the function in the main program and plot the signal without the continuous component.
0
A
T TMAX
t[ms]
xa(t)
T/2
0
A
T TMAX
t[ms]
xa(t)
T/2
Digital signal processing Homework 1
EXERCISE 8 Let the analog signal xa (t) in the figure (full-wave rectified sinusoidal signal) with the following parameters: - Frequency F0=450 Hz - A=4 - acquisition time TMAX=80 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with the sampling frequency Fs=12 kHz. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the DC component (mean value) using the discrete signal samples x(n) and returns the calculated mean value and the signal without the continuous component. Call the function in the main program and plot the signal without the continuous component. EXERCISE 9 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=400 Hz - A=3 - acquisition time TMAX=40 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with sampling frequency Fs=16 kHz. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the zero-cross rate and the signal energy, using the discrete signal samples x(n). Call the function in the main program and display the results. EXERCISE 10 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=200 Hz - A=2.5 - acquisition time TMAX=60 ms
0
A
T TMAX
t[ms]
xa(t)
T/2
0
A 2A/3
T TMAX
t[ms]
xa(t)
-A
0
A
A/2
T TMAX
t[ms]
xa(t)
T/2
Digital signal processing Homework 1
a) Generate the discrete signal x(n) obtained by sampling xa(t) with the sampling frequency Fs=16 kHz. Note: You can use the sawtooth function. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the derivative with finite differences
( ) ( 1) ( 1) / 2d n x n x n using the discrete signal samples x(n). Call the function in the
main program and plot on the same figure (two subplots) the initial signal and the derived signal. EXERCISE 11 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=250 Hz - A=4 - acquisition time TMAX=80 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with the sampling frequency Fs=12 kHz. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the mean value and the signal mean power using the discrete signal samples x(n). Call the function in the main program and display the results. EXERCISE 12 Let the analog signal xa (t) in the figure with the following parameters: - Frequency F0=400 Hz - A=3 - acquisition time TMAX=20 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with the sampling frequency Fs=16 kHz. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 256 and for NDFT = 512. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the zero-cross rate and the signal mean value, using the discrete signal samples x(n). Call the function in the main program and display the results.
0
A
A/2
T TMAX
t[ms]
xa(t)
T/3 2T/3
0
A
A/3
T TMAX
t[ms]
xa(t)
T/2 -A/3
-A
Digital signal processing Homework 1
EXERCISE 13
Let the analog signal 0( ) 1 0.3sin 2 cos 2a Mx t F t F t with the following parameters:
- Modulation frequency FM=300 Hz. - Carrier frequency F0=3 kHz. - acquisition time TMAX=60 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with the sampling frequency Fs=12 kHz. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 512 and for NDFT = 1024. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the absolute mean value (the mean value of |x(n)|) and the signal mean power using the discrete signal samples x(n). Call the function in the main program and display the results. EXERCISE 14
Let the analog signal 0( ) 2 1 0.5sin 2 cos 2a Mx t F t F t with the following
parameters: - Modulation frequency FM=240 Hz. - Carrier frequency F0=2 kHz. - acquisition time TMAX=50 ms a) Generate the discrete signal x(n) obtained by sampling xa(t) with the sampling frequency Fs=8 kHz. b) Calculate the DFT of the signal x(n) on a number of points equal to the length L of the signal. c) Resume point b) for NDFT = 256 and for NDFT = 512. Explain the differences between the spectra obtained at points b) and c). d) Make a function that calculates the zero-cross rate and the signal energy, using the discrete signal samples x(n). Call the function in the main program and display the results.
top related