Lecture 7 Frequency Modulation Fundamentals of Digital Signal Processing Spring, 2012 Wei-Ta Chu 2012/3/15 1
Time-Frequency Spectrum We have seen that a wide range of interesting waveforms can be synthesized by the equation These waveforms range from constants, to cosine signals, to general periodic signals, to complicated- looking signals that are not periodic. One assumption have made so far is that the amplitudes, phases, and frequencies do not change with time. However, most real-world signals exhibit frequency changes over time. Music is the best example. 2
Time-Frequency Spectrum For very short time intervals, the music may have a constant spectrum, but over the long term, the frequency content of the music changes dramatically. Most interesting signals can be modeled as a sum of sinusoids if we let the frequencies, amplitudes, and phases vary with time. A way to describe such time-frequency variations spectrogram. ( 頻譜圖 ) 3
Stepped Frequency The simplest example of time-varying frequency content is to make a waveform whose frequency stays constant for a short duration and then steps to higher (or lower) frequency An octave is doubling the frequency Middle C D E F G A B C 262 Hz 294 330 349 392 440 494 523 4
Spectrogram Analysis It s not easy to write a simple mathematical formula like the Fourier series integral to do the analysis. (Chapter 13) MTALAB specgram function The calculation is performed by doing a frequency analysis on short segments (e.g. 25.6 msec) of the signal and plotting the results at the specific time at which the analysis is done. By repeating the process with slight displacement in time, a two-dimensional array is created whose magnitude can be displayed as a grayscale image, whose horizontal axis is time and whose vertical axis is frequency. 5
Demo 6
Frequency Modulation Create signals whose frequency is time-varying A chirp signal is a swept-frequency signal whose frequency changes linearly from some low value to a high one. E.g. begin at 220 Hz and go up to 2320 Hz One method for producing such a signal is to concatenate a large number of short constant-frequency sinusoids Boundary between the short sinusoids will be discontinuous unless we adjust the initial phase of each small sinusoid 7
Frequency Modulation Write a formula to get time-varying frequency If we regard a constant-frequency sinusoid as the real part of a complex phasor Then the angle function of this signal is the exponent which obviously changes linearly with time. The time derivative of the angle function is, which equals the constant frequency. We adopt the following general notation for the class of signals with time-varying angle function: 8 denotes the angle function versus time.
Frequency Modulation We can create a signal with quadratic angle function by defining Now we can define the instantaneous frequency for these signals as the slope of the angle function (i.e. its derivative) Where the units of are rad/sec, or, if we divide by (Hz) (rad/sec) 9
Frequency Modulation If the angle function of x(t) is quadratic, then its frequency changes linearly with time; that is, The frequency variation produced by the time-varying angle function is called frequency modulation, and the signals of this class are called FM signals. Since the linear variation of the frequency can produce an audible sound similar to a siren or a chirp, the linear FM signals also called chirp signals. 10
Frequency Modulation The instantaneous frequency is the derivative of the angle function. Thus, if a certain linear frequency sweep is desired, the actual angle function is obtained from the integral of Suppose we want to synthesize a frequency sweep from f 1 =220 Hz to f 2 =2320 Hz over a 3-sec time interval, i.e. the beginning and ending times are t=0 and t=t 2 =3 sec. Integrate to get the angle function: The phase shift is an arbitrary constant. The chirp signal is 11
Example f 1 = 100 Hz, f 2 =500 Hz, T 2 =0.04 sec Instantaneous frequency Concentrate on the time range the 300-Hz sinusoid matches the chirp in this time region See near where the chirp frequency is equal to 500 Hz 12
Instantaneous Frequency The instantaneous frequency of the signal is the derivative of the angle function If is constant, the frequency is zero. If is linear, x(t) is a sinusoid at some fixed frequency. If is quadratic, x(t) is a chirp signal whose frequency changes linearly versus time. More complicated variations of can produce a wide variety of signals. One application is in music synthesis. 13
Homework 2 Chapter 3: P-3.5, 3.6, 3.12, 3.17 Hand over your homework in the class at Mar. 22 14
Lecture 7 Sampling Fundamentals of Digital Signal Processing Spring, 2012 Wei-Ta Chu 2012/3/15 15
Sampling Examples of continuous-time signals. It s also common to refer as analog signals because both the signal amplitude and the time variable are assumed to be real (not discrete) numbers. t is a continuous variable. Digital computers cannot deal with continuous-time signals directly; instead, they must represent and manipulate them numerically or symbolically. The key point is that any computer representation is discrete. A discrete-time signal is represented mathematically by an indexed sequence of numbers. 16
Sampling We can sample a continuous-time signal at equally spaced time instants, t n =nt s ; that is The individual values of x[n] are called samples of continuous-time signal. T s : sampling period f s : sampling rate or sampling frequency 17
Sampling We can compute the values of a discrete-time signal directly from a formula The sequence of values corresponding to When we plot discrete-time signals, use the format as 18
Sampling Sinusoidal Signals Sampling a sinusoidal signal Where we define Normalized radian frequency The signal x[n] is a discrete-time cosine signal, and is its discrete-time frequency. is a normalized version of the continuous-time radian frequency with respect to the sampling frequency. Since has units of rad/sec, then units of are radians. 19
Sampling Sinusoidal Signals An infinite number of continuous-time sinusoidal signals can be transformed into the same discrete-time sinusoid by sampling. All we need to do is to change the sampling period inversely proportional to the input frequency of the continuous-time sinusoid. E.g. if rad/sec and T s =1/2000 sec, then rad. On the other hand, if rad/sec and T s =1/10000 sec, is still equal to 20
Sampling Sinusoidal Signals T s = 0.5 msec = 0.0005 sec T 0 = 1/100 = 0.01 sec There are 20 samples (0.01/0.0005) per period T s = 2 msec = 0.002 sec f s = 500 samples/sec Five samples per period 21
The Concept of Aliasing Aliasing ( 化名 ): two names for the same person, or thing Consider and Aliasing is solely due to the fact that trigonometric functions are periodic with period These continuous cosine signals are equal at integer values n Sampled with T s = 1 22
The Concept of Aliasing The frequency of x 2 [n] is, while the frequency of x 1 [n] is. When speaking about the frequencies, we say that is an alias of E.g. Show that is an alias of The following formula holds for the frequency aliases: Where is the smallest of all the aliases, it s sometimes called the principal alias. 23
The Concept of Aliasing Note that, so we can generate another alias for x 1 [n] as follows: A general form for all the alias frequencies of this type These aliases of a negative frequency are called folded aliases 24
The Concept of Aliasing Extra relation between folded aliases and the principal alias folded aliases principal aliases Note that the algebra sign of the phase angles of the folded aliases must be opposite to the sign of the phase angle of the principal alias 25
Summary We can write the following general formulas for all aliases of a sinusoid with frequency Because the following signals are equal for all n 26
Spectrum of a Discrete-Time Signal Drawing the spectrum representation of the principal alias along with several more of the other aliases. Spectrum of discrete-time signal 跟 spectrum of continuous-time signal 的意義稍有不同 In continuous case, all the spectrum components were added together to synthesize the continuous-time signal. In discrete case, we simply need to select one spectrum component to synthesize the discrete-time signal. Spectrum of continuous-time signal 27
The Sampling Theorem How frequently we must sample in order to retain enough information to reconstruct the original continuous-time signal from it samples? Shannon Sampling Theorem A continuous-time signal x(t) with frequencies no higher than f max can be reconstructed exactly from its samples x[n]=x(nt s ), if the samples are taken at a rate f s =1/T s that is greater than 2f max. 28
The Sampling Theorem The minimum sampling rate of 2f max is called the Nyquist rate. We can see examples of the sampling theorem in many commercial products. E.g. CDs use a sampling rate of 44.1 khz for storing music signals in a digital format. This number is slightly more than two times 20 khz, which is the generally accepted upper limit for human hearing. Reconstruction of a sinusoid is possible if we have at least two samples per period. What happens when we don t sample fast enough? Aliasing occurs 29
Ideal Reconstruction Since the sampling process of the ideal C-to-D converter is defined by the substitution t=n/f s, we would expect the same relationship to govern the ideal D-to-C converter This substitution is only true when y(t) is a sum of sinusoids 30
Ideal Reconstruction An actual D-to-A converter involves more than this substitution, because it must also fill in the signal values between the sampling times, t n =nt s. In Section 4-4, we will see how interpolation can be used to build an A-to-D converter that approximates the behavior of the ideal C-to-D converter. In Chapter 12, we will use Fourier transform theory to show how to build better A-to-D converters by incorporating a lowpass filter. 31
Ideal Reconstruction If the ideal C-to-D converter works correctly for a sampled cosine signal, then we can describe its operation as frequency scaling. For example, the discrete-time frequency of y[n] is the continuous-time frequency of y(t) is The discrete-time signal has aliases. Which discretetime frequency will be used? The selection is the lowest possible frequency components (the principal aliases) When converting from to analog frequency, the output frequency always lies between and 32
Summary The Shannon sampling theorem guarantees that if x(t) contains no frequencies higher than f max and if f s >2f max, then the output signal y(t) of the ideal D-to-C converter is equal to the signal x(t) 33