Spectral analysis of signals Lecturer: dr hab. inż. Janusz ieznański, prof. nadzw. PG (WEiA, PG) Level of study PhD Year of study 1 Seester 1 Duration 20 Hrs ECTS 4 Course objective Learning outcoes Content Suggested reading Grading ethod Course language Achieving the learning outcoes indicated below, notably deepening the student s knowledge and skills in the signal analysis and signal processing, along with the capability to apply the knowledge to practical engineering probles. KW-1, KU-1, KK-1 LECTURE (10 hours) Eleentary continuous-tie signals. Sapling and discrete-tie signals. Frequency of discrete-tie signals. Coplex exponential signals and their orthogonality. Coplex Fourier series of continuous-tie and discrete-tie signals. Fourier transfor of continuous-tie and discrete-tie signals. Discrete Fourier transfor (DFT). Recursive coputation of DFT. Spectral factoring of PAM signals. Reconstruction of analog signals. Upsapling and downsapling. Spectral analysis of distorted power line wavefors (single-phase and three-phase); evaluation of haronic distortion of voltages and currents. Related topics: phase locked-loop, coordinate transforations in ultiphase systes, active power filters, spectru analyzers for EMC applications etc. LABORATORY (10 hours) Using sapling and DFT for the analysis of selected continuous-tie signals. Recursive ipleentation of DTF. Measureent of the fundaental haronic of a distorted and/or aplitude-odulated signal. Ipleentation of the phase-locked loop (PLL). Exaple spectral analyses of distorted power line wavefors (single-phase and three-phase). Coputing the total haronic distortion (THD) of power line wavefors. 1. Chen Chi-Tsong: Syste and Signal Analysis. 2nd edition, Saunders College Publishing, 1994 2. Jackson L.B.: Digital Filters and Signal Processing. 3rd edition, Kluwer Acadeic Publishers, 1996. 3. Lyons R.G.: Understanding Digital Signal Processing. 3rd Edition, Prentice Hall, 2010 (Polish translation available: Wprowadzenie do cyfrowego przetwarzania sygnałów. WKŁ 2010). Test of lecture-related knowledge (50%) Evaluation of laboratory assignents (50%) English Projekt Centru Studiów Zaawansowanych - rozwój interdyscyplinarnych studiów doktoranckich na Politechnice Gdańskiej w obszarach kluczowych w kontekście celów Strategii Europa 2020 jest współfinansowany przez Unię Europejską w raach Europejskiego Funduszu
Exaple test questions 1. A periodic sequence of period is ade of the following saples (per period): 4, 2, 0, 3, 0, -3, 2, 0. Find the Fourier series coefficient c2. d 2. Find an approxiate value of Fourier series coefficient c 11 of a sequence obtained by sapling an analog periodic signal whose Fourier coefficients are given by c a 2, + 1 2 Z The sapling frequency is 27 saples per period. The approxiation should take into account 5 aliased haronics of the analog signal. 3. Deterine the Fourier series expansion of the analog periodic signal shown below using the spectral factorization into the discriination factor and shape factor. Hint: The Fourier transfor of the rectangular pulse sketched below is given by F Ωa π ( Ω ) 2 aa sinc Use this forula and the tie-shifting property of the Fourier transfor to find the required shape factor. Projekt Centru Studiów Zaawansowanych - rozwój interdyscyplinarnych studiów doktoranckich na Politechnice Gdańskiej w obszarach kluczowych w kontekście celów Strategii Europa 2020 jest współfinansowany przez Unię Europejską w raach Europejskiego Funduszu
Exaple laboratory tasks Task 1 (wavefor approxiation by partial Fourier series) Write a MATLAB function M-file with the following call syntax: [y,t]rectappr0(m) coputing an approxiation of a square wave of aplitude Vax as a partial su of its Fourier series. The approxiation should be ade of M odd real haronics. The Fourier coefficients of the coplex expansion can be evaluated using the following forula: c ( ) 1 1 2 2Vax 1 π The outputs of the function are as follows: t is a tie vector that spans two fundaental periods and has sufficient resolution to ensure that the graph of the approxiation created by the plot function is not visibly distorted; y is a vector of values of the approxiating wavefor at tie points in t. Useful relationships: j 0t jω t ( Ω t + φ ) c e Ω + c e 0 A cos c A 2 e 0 jφ, c A 2 e jφ where c denotes Fourier coefficients of the coplex expansion. Suggested tests: Call the rectappr0 function fro MATLAB coand window, starting with M1 >> [y,t] rectappr0(1); and plot the result using >> plot(t,y); grid Repeat the above coands for increasing values of M and observe how the the approxiation converges to the square wave. Make sure that the tie resolution reains adequate as M increases. ote the appearance of the approxiation around the points of discontinuity of the square wave. Task 4 (recursive coputation of DFT) Write a MATLAB function M-file with the following call syntax: crecursive_dft(,n,x) ipleenting recursive coputation of the Fourier series coefficients of discretetie sequence x. The arguent n is the order of the haronic for which the coefficients are to be coputed, while denotes the period of the analyzed sequence (sequence x ay contain transient states, but it is assued that it is periodic with period at steady state). The output c is a vector (tie sequence) of Fourier series coefficients of the n-th haronic of x. Projekt Centru Studiów Zaawansowanych - rozwój interdyscyplinarnych studiów doktoranckich na Politechnice Gdańskiej w obszarach kluczowych w kontekście celów Strategii Europa 2020 jest współfinansowany przez Unię Europejską w raach Europejskiego Funduszu
Hints: Consider the conventional discrete Fourier transfor (DFT): 1 k 0 [ ] x[ k] e 2π j k It coputes the saples of the Fourier transfor of sequence x[k] based on tie saples at k 0, 1,, -1. The sequence can be considered finite-duration (with zero values at other saple points k) or periodic with period. In the latter case, the DFT divided by represents the coefficients of the Fourier series: [ ] c (2) Strictly speaking, a periodic signal never exhibits any changes in its repeatable pattern (the sae periodic pattern is repeated over tie fro inus to plus infinity). As a practical atter, however, signals that are noinally periodic (such as the power line voltages and currents) inevitably exhibit various fors of sporadic or slow variation. Despite the fact that such signals are not sensu stricto periodic, it is sensible (and even necessary!) to evaluate their fundaental aplitude or rs value, as well as their haronic content (both changing over tie). To this end, we can evaluate the Fourier coefficients of interest over owing tie windows in such a way that at a current saple tie k the windows spans over the ost recent saple ties (that is, k-+1 through k). The ovingwindow DFT forula could be as follows: [ k] x[ r] k r k + 1 e 2π j 2π j r k r k + [ ] W [ r ] x 1r (1), (3) where W e. In this case the Fourier transfor saples are theselves tie sequences (functions of discrete tie k), which is reflected by the odified notation (the haronic order is now used as a subscript and the dependence of on tie k is explicitly indicated). Consider the sets of values assued by the bound variable r for [ k 1] [ k]. [ k 1] [ k] and The coparison of the above sets suggests a siple ethod of recursive k k 1 : coputation of [ ] based on [ ] [ k] [ k 1 ] x[ k ] W [ k ] + x[ k] W [ k] [ k ] P[ k ] P[ k] 1 + (4) Projekt Centru Studiów Zaawansowanych - rozwój interdyscyplinarnych studiów doktoranckich na Politechnice Gdańskiej w obszarach kluczowych w kontekście celów Strategii Europa 2020 jest współfinansowany przez Unię Europejską w raach Europejskiego Funduszu
, the values of [ k 1] and P[ k ] should be available as previously coputed and stored values. The evaluation of [ k] only takes When coputing [ k] coputing the new saple product P [ k], adding it to the previous transfor value [ k 1] and subtracting the oldest saple product P[ k ] included in the coputation of [ k 1]. Each newly coputed saple product [ k] becoes [ k ] P effectively P after saple periods, eaning that it is necessary not only in the current coputation, but will also be necessary in a future coputation, and thus it should be stored over the consecutive saple periods. A convenient way to achieve this is to use a cyclic buffer of length. The idea is illustrated in the figure below. Assue that at a given tie k the circular buffer ade of cells stores ost recent saple products P[.] denoted P[oldest_tie] through P[oldest_tie+-1]. The latter product was coputed at tie k-1. At tie k we will need the value of P[oldest_tie] stored in the buffer, so the buffer address at tie k (denoted cirbuf_address in the figure) should indicate the cell holding this value. Once P[oldest_tie] has been retrieved and used in coputing the new transfor value, the cell can be used to store the new saple product for future use, whereupon the buffer address should be increented to indicate the stored product value to be used in the next coputation. In constructing a MATLAB ipleentation of recursive DFT, use the following variables: a scalar intended to store the current value of the transfor (it corresponds k k 1 in eqn. 4); to both [ ] and [ ] c a vector intended to store the tie sequence of Fourier series coefficients of the analyzed sequence x; the entries in c are the consecutive values of /; the length of c is length(x); cirbuff a vector of length serving as a circular buffer; cirbuff_address a scalar used to address (index) the cirbuff (the address should be increented odulo to ensure that the buffer is circular); for the appropriate value of the address, cirbuff(cirbuff_address) will P k in eqn. 4); correspond to [ ] new_product a scalar representing the product of the new signal saple and the appropriate coplex exponential saple; it corresponds to P[k] in eqn. 4. Projekt Centru Studiów Zaawansowanych - rozwój interdyscyplinarnych studiów doktoranckich na Politechnice Gdańskiej w obszarach kluczowych w kontekście celów Strategii Europa 2020 jest współfinansowany przez Unię Europejską w raach Europejskiego Funduszu
Using the above ideas, the coputation of ight be perfored in the following steps: 1) copute the new_product (that is, the product of the new signal saple and the appropriate coplex exponential saple); new_product corresponds to k in (4); [ ] 2) copute - cirbuff(cirbuff_address)+ new_product (that is, copute eqn. 4); 3) store new_product in cirbuff(cirbuff_address) for future use; 4) increent cirbuff_address (with reduction odulo ); 5) append / to c (i.e. the vector of Fourier series coefficients); 6) go back to step 1 (until the last saple in x has been reached). Suggested tests: Projekt Centru Studiów Zaawansowanych - rozwój interdyscyplinarnych studiów doktoranckich na Politechnice Gdańskiej w obszarach kluczowych w kontekście celów Strategii Europa 2020 jest współfinansowany przez Unię Europejską w raach Europejskiego Funduszu
1) Synthesize a sequence ade of a fundaental frequency sine wave of unity aplitude and a third haronic of aplitude 0.3. The sequence should span two fundaental periods. Analyze the sequence using recursive_dft. Start by coputing the Fourier coefficients corresponding to the fundaental haronic, then plot and interpret the coefficient sequence. Repeat the sae for the third haronic. 2) Synthesize a sequence ade of a sine wave which is aplitude-odulated by a piecewise-constant odulating sequence. The initial section of the odulating sequence should have aplitude 1.0 and the subsequent sections each should have aplitude increased by 0.1 copared to the preceding section. The length of each section should be equal to 10 periods of the sine wave. Both sequences should span 100 periods of the sine wave. Analyze the sequence using recursive_dft. Plot and interpret the coefficient sequence. TERMIY WYKLADÓW Data Dzień tygodnia Godzina Sala 2014-04-02 środa 13.15-15.15 WEiA E28 2014-04-09 środa 13.15-15.15 WEiA E28 2014-04-16 środa 13.15-15.15 WEiA E28 2014-04-23 środa 13.15-15.15 WEiA E28 2014-05-07 środa 13.15-15.15 WEiA E28 2014-05-14 środa 13.15-15.15 WEiA E28 2014-05-21 środa 13.15-15.15 WEiA E28 2014-05-28 środa 13.15-14.00 WEiA E28 Projekt Centru Studiów Zaawansowanych - rozwój interdyscyplinarnych studiów doktoranckich na Politechnice Gdańskiej w obszarach kluczowych w kontekście celów Strategii Europa 2020 jest współfinansowany przez Unię Europejską w raach Europejskiego Funduszu