Presentation is loading. Please wait.

Presentation is loading. Please wait.

MM3FC Mathematical Modeling 3 LECTURE 1

Similar presentations


Presentation on theme: "MM3FC Mathematical Modeling 3 LECTURE 1"— Presentation transcript:

1 MM3FC Mathematical Modeling 3 LECTURE 1
Times Weeks 7,8 & 9. Lectures : Mon,Tues,Wed 10-11am, Rm.1439 Tutorials : Thurs, 10am, Rm. ULT. Clinics : Fri, 8am, Rm.4.503 Dr. Charles Unsworth, Department of Engineering Science, Rm Tel : ext. 2461

2 We are going to do this through simple filter theory
The Big Plan Aim of course Understand the ‘Discrete Fourier Transform’ (DFT) . We are going to do this through simple filter theory Learn how to represent signals mathematically. Learn about FIR filters, impulse & frequency response. The z-transform, how it helps in the design of filters. Learn how to design lowpass, highpass, bandpass and nulling filters. Show how the DFT can be represented as a bank of filters.

3 This Lecture What are we going to cover & Why ?
Sinusoidal representation of continuous signals. (because sinusoids make up all signals) Complex exponentials & phasors. (to simplify the addition & multiplication of sinusoids) Spectrum Representation. (to represent frequency content of a mixed signal)

4 The most general mathematical formula for a sinusoid
Sinusoids The most general mathematical formula for a sinusoid x(t) = A cos(2π f t + φ) x(t) = amplitude at time (t) A = maximum amplitude of sinusoid, f = frequency = 1/T in Hz, where T = period in secs. φ = phase shift in rads. ω = angular frequency = 2πf in rads/sec Can only do two things to the sinusoid of a set frequency : We can magnify it in amplitude We can shift it in phase Note * Say if we want to shift the sinusoid to the : right (in the positive direction) then phi +ve Left (in the negative direction) then phi –ve Thus, x(t) = Asin(ω0 t + φ) = Acos(ω0 t + φ – pi/2) = Acos(ω0 t + φ + 3pi/2) . (Shift the sinewave to the position of the cosine wave to stop confusion). 3) You might think we can compress or stretch it along its x-axis but this would change its frequency

5 Example 1 : Determine A, w, f, φ & T of the following signals :
x(t) = 12cos(12pt + p/3) y(t) = 16sin(200pt – p/9)

6 Can only do two things to the sinusoid of a set frequency :
x(t) = A cos(wt + φ) 1) We can magnify it in amplitude, A. 2) We can shift it in phase, φ. SHIFTING SIGN CONVENTION If we want to shift the sinusoid to the : Right (in the positive direction) then φ is -ve Left (in the negative direction) then φ is +ve IMPORTANT SINE/COSINE RELATIONSHIP sin(wt + φ) = cos(wt + (φ - π/2f)) cos(wt + φ) = sin(wt + (φ + π/2f))

7 3) In Signal Analysis, we always change sines to cosines using these relations.
(This is to make the math easy when we deal with complex numbers, later.) Example 2 : Change sin(wt + π/3) to cosine form. Plot both the sine and cosine result and verify using the shifting properties. We see sin(wt + π/3) is sine shifted π/3 in the –ve direction. This moves the maxima of sin(wt) at π/2 to the new position (π/2 - π/3) = π/6 from the origin.

8 From the sine/cosine relations
sin(wt + π/3) = cos(wt + (π/3 - π/2)) = cos(wt - π/6) Thus, cos(wt - π/6) is cos shifted π/6 in the +ve direction. This moves the maxima cos(wt) at 0 to the new position π/6 from the origin. Hence. Both the sine and cosine maximas lie on top of each other.

9 Example 3 : What is the Amplitude, frequency and phase of the equivalent sine/cosine.
A) x(t) = 12cos(200πt + π/3) B) y(t) = 16sin(160πt – π/9)

10 Here is the MATLAB code used to plot :
x(t) = 10 cos(2π 1000 t + π/2 ). A = 10; f = 1000; phi = pi/2; T = 1/f; t = -2*T : T/40 : 2*T; x = A*cos(2*pi*f*t + phi); plot(t,x) title('Sinusoid: x(t) = 10 cos(2*pi*1000*t + pi/2)'); xlabel('Time (sec)'); grid on NOTE ** This will give us 40 points per period. Line by line this code does: 1.Define the three parameters for the plot, A=amplitude, f0=frequency, and phi=phase angle. 2.The period, T0, is 1 over the frequency. 3.tt is the time axis for the plot, here we start 2 periods before 0 and quit 2 periods after. 4.Here the values of the cosine are computed. 5.The plot. 6.Put a title on the plot so we know what it is. 7.Also label the x axis. 8.Show the grid. You can copy and paste this code into MATLAB to test it. : We will see in sampling and aliasing that only 2 or samples/period is necessary to digitally record the signal

11 Continuous & Discrete Signals
Real world signals are “continuous ” in time. Any recorded signal is said to be “discrete ” in time. It is impossible to collect every time sample of a real world signal. The “trick” is to “sample” the data to collect enough points such that the signal is accurately represented. Shannon’s sampling theorem states In order to recover a signal of frequency (f) We have to sample at a minimum frequency of (2f). (Namely, we must have a minimum of 2 points/period)

12 Complex Exponentials & Phasors
Believe it or not !! … Analysis & manipulation of sinusoids is “ greatly simplified ” by using complex exponentials. First let’s review complex numbers. z = x + j y , (z) is a the complex number. (x) is the real part of (y) is the imaginary part of z (j) is an imaginary number = Re(z) Im(z) y x z Here we show how to Find roots of polynomials, Manipulate complex numbers and Find roots of Unity. Finding roots of polynomials MATLAB can find the roots of polynomials via the roots command. To find the roots of 2 z + 6 z + 25 you enter the coefficients of z EDU>>eqn = [1 6 25] eqn = and ask for the roots: EDU>>roots(eqn) ans = i i Notice that this is the same answer as given in the book. MATLAB outputs i as the square root of -1, but you can use j too. Manipulating complex numbers There are many commands for manipulating complex numbers. You can guess what they do by their names. EDU>>z = 3 + j*4 z = i EDU>>real(z) 3 EDU>>imag(z) 4 EDU>>conj(z) i EDU>>abs(z) 5 EDU>>angle(z) 0.9273 Note the angle is in radians, you can convert to degrees by: EDU>>angle(z)*180/pi If you want to input as polar use: EDU>>z2=10*exp(j*pi/4) z2 = i or EDU>>10*exp(j*45/180*pi)

13 Re(z) Im(z) y x Re(z) Im(z) y x z r θ Cartesian Form z = x + jy Polar form x = r cosθ y = r sinθ The polar form is very clumsy, better to make use of Euler’s famous formula.

14 Complex exponential representation of a sinusoid
Euler’s formula : ejq = cosq + jsinq Now, from cartesian coords : z = x + jy From polar coordinates : x = rcosθ & y = rsinθ z = rcosq + rsinq Complex exponential representation of a sinusoid z = rejq

15 1 = e , In this form all the rules of indices hold :
2p j e - b a + , … 1.6 Now s’ppose we have : z1 = r1ejα & z2 = r2ejβ Multiplying 2 complex numbers or exponentials we multiply magnitude & add the phases z3 = z1.z2 = r1ejα. r2ejβ = r1r2 ejα ej β = r1r2 ej(α + β)

16 How do we express a sinusoid
in exponential form ? The most general mathematical formula for a sinusoid x(t) = A cos(2πft + φ) Now consider the expansion of : A e j(2πft + φ) = Acos(2πft + φ) + jAsin(2πft + φ) A sinusoid is the product of 2 exponentials x(t) = Re { Ae j(2πft + φ) } = Re { Ae j(2πft )ejφ } = Ae j(2πft )ejφ Sometimes we just drop the Re{ }, for convienience.

17 Example 4 : Write in complex exponent form :
x(t) = 3cos(50πt + π/6) y(t) = 2sin(2πt – π/3) Hence, determine : C) x(t)y(t) D) x(t)/y(t)

18 Using Inverse Euler Formulas
… 1.8 The equation for a sinusoid x(t) = A cos(wt + φ) becomes : … 1.9

19 We now have two representations of a sinusoid.
Re(z) Im(z) +wt +wt Im(z) Im(z) -wt A A/2 φ φ OR + Re(z) A/2 As a rotating phasor with amplitude (A) and frequency (w). 2) Two counter rotating phasors of amplitude (A/2) and frequencies (w) & (-w)

20 Example 6 : Express as an additive linear combination of exponentials :
x(t) = 3cos(3πt + π/12) y(t) = 5sin(24 πt – π/7)

21 The Spectrum The way we are use to observing a signal is by viewing its time-course. This is known as the “time domain representation” of the signal. The spectrum is a graphical representation of the frequency content of the sum of sinusoids in a signal. Known as the “frequency domain representation” of the signal. This visual form allows us to see the relationships between the different frequency components and their relative amplitudes quickly and easy.

22 A spectrum can be produced from “additive linear combination” of a constant and (N) sinusoids with different frequency, amplitude and phase. Using Inverse Euler formulae … 1.10 … 1.11

23 {(X0,0), (X1,f1), (X1*,-f1), (X2,f2), (X2*,-f2), …}
NOTE** Observe what happens for k=1,2. For each (fk) the we have ‘complex conjugate pair’ that represents the sinusoidal component contributing at frequency (fk) . So we could write this as : {(X0,0), (X1,f1), (X1*,-f1), (X2,f2), (X2*,-f2), …} (2N+1) frequency components with Magnitude’s (X0) is a DC component that can be expressed as complex exponential signal with a frequency of zero. The ‘Magnitude Spectrum’ of the signal x(t) is a plot of |Xk| vs. f. … 1.12

24 x(t) = 10 + 14cos(200πt – π/3) + 8cos(500πt + π/2)
Example 7 : Plot the Magnitude Spectrum for the continuous signal. x(t) = cos(200πt – π/3) + 8cos(500πt + π/2) Apply inverse Euler Formula x(t) = 10 + 7e-j π/3 e j2π(100)t + 7ej π/3 e -j2π(100)t + 4ej π/2 e j2π(250)t + 4e-j π/2 e -j2π(250)t Thus, {(10,0),(7e-j π/3, 100),(7ej π/3, -100),(4ej π/2, 250),(4e-j π/2, -250)} Draw each frequency as a vertical line of length of magnitude |Xk| 100 250 -100 -250 f(Hz) |10| |7ej π/3| |7e-j π/3| |4ej π/2| |4e-j π/2| Two-sided Magnitude Spectrum MAGNITUDE |Xk| Can only do two things to the sinusoid of a set frequency : We can magnify it in amplitude We can shift it in phase Note * Say if we want to shift the sinusoid to the : right (in the positive direction) then phi +ve Left (in the negative direction) then phi –ve Thus, x(t) = Asin(ω0 t + φ) = Acos(ω0 t + φ – pi/2) = Acos(ω0 t + φ + 3pi/2) . (Shift the sinewave to the position of the cosine wave to stop confusion). 3) You might think we can compress or stretch it along its x-axis but this would change its frequency


Download ppt "MM3FC Mathematical Modeling 3 LECTURE 1"

Similar presentations


Ads by Google