Вы находитесь на странице: 1из 20

ECEN 4652/5002

04-03-13

Communications Lab

Spring 2013
P. Mathys

Lab 10: Real Bandpass and Complex Lowpass Signals, QAM, General BPFs
1 Introduction
Modern communication systems are often implemented as a combination of digital and analog hardware. The digital part generally consists of a DSP (dgital signal processing) chip with associated software, and/or ASICs (application specic integrated circuit), FPGAs (eldprogrammable gate arrays), etc. The analog part is usually used to frequency-shift, lter and amplify the transmitted and received signal at radio frequencies (RF). To interface beteeen the digital and analog parts, A/D (analog to digital) and D/A (digital to analog) converters are used. Digital hardware and associated software is able to produce and process signals with very precise specications and reproducible characteristics. But because the processing speed in a digital system has to be at least twice the highest signal frequency, the carrier frequencies at which radio signals can be processed directly in the digital domain are limited, roughly to the MHz or at most the sub-GHz range. Analog hardware, on the other hand, can be built relatively easily up into the GHz region. But once built, it cannot just be reprogrammed for another application. Also, component tolerances and component aging limit the precision of analog signal shaping that can be achieved economically. The best design philosophy to adopt is therefore to perform all precise and complicated signal processing functions at the lower frequencies which DSP hardware can handle directly, and to use the analog hardware only for amplication of low level signals, simple ltering, and frequency conversion to and from the high RF frequencies. The mathematical tool that enables this approach is the frequency shift property of the Fourier transform, which allows real-valued bandpass signals to be converted to complex-valued lowpass signals and vice versa.

1.1

Complex Lowpass Representation of Real Bandpass Signals

A real-valued bandpass (RBP) signal with center frequency fc and bandwidth 2fL is a signal x(t) whose Fourier transform (FT) X (f ) satises X (f ) = X (f ) , and |X (f )| = 0 , for 0 |f | < fc fL and |f | > fc +fL .

An example of the FT of a RBP signal is shown in the graph below.

X (f ) A fc +fL fc fL fc A fc fL fc fc +fL f

Since X (f ) = X (f ), it suces to know X (f ) for f > 0. Shifted left by fc and multiplied by 2, this yields XL (f ) xL (t) as shown below for the example X (f ).
XL ( f ) 2A fL fL 2A f

The signal xL (t), which is complex-valued in general, is called a complex-valued lowpass (CLP) signal and xL (t) is the CLP representation of the RBP signal x(t). Note that if x(t) has bandwidth 2fL , then xL (t) has bandwidth fL . To recover x(t) from xL (t) use x(t) = Re{xL (t) e Using the FT pairs xL (t) ej 2fc t this corresponds to
(f fc ) XL (f fc ) + XL X (f ) = 2 j 2fc t j 2fc t xL (t) ej 2fc t + x L (t) e . }= 2

XL (f fc ) ,

and

j 2fc t x L (t) e

XL (f fc ) ,

X (f ) = X (f ) ,

in the frequency domain. Since xL (t) is complex-valued, it can be written as xL (t) = Re{xL (t)} + j Im{xL (t)} = xLi (t) + j xLq (t) , where xLi (t) is the in-phase component (or real part) of xL (t) and xLq (t) is the quadrature component (or imaginary part) of xL (t). From xL (t) XL (f ) and x L (t) XL (f ), the FTs of xLi (t) and xLq (t) are obtained as follows: xL (t) + x L (t) 2 xL (t) x L (t) xLq (t) = Im{xL (t)} = 2j xLi (t) = Re{xL (t)} = 2
XL (f ) + XL (f ) , 2 XL ( f ) XL (f ) XLq (f ) = . 2j

XLi (f ) =

Therefore XL (f ) = XLi (f ) + j XLq (f ) . But note that, while xLi (t) and xLq (t) are real-valued, their FTs XLi (f ) and XLq (f ) are complex-valued in general. The following gure shows XLi (f ) and XLq (f ) for the example of X (f ) that was given earlier.
XLi (f ) 2A A fL 0 fL f fL jA 2jA XLq (f ) 2jA jA

fL

The blockdiagram given below shows how to convert the RBP signal x(t) to its CLP representation xL (t) and how to reconstruct x(t) from xL (t).
x(t) 2ej 2fc t v (t) LPF at fL xL (t) xL (t) ej 2fc t w (t) Re{.} x(t)

Note that, except for x(t), all signals are complex-valued. An implementation of the conversion from x(t) to xL (t) = xLi (t) + j xLq (t), and vice versa, that uses only real-valued signals is shown in the next blockdiagram.
x(t) vi (t) LPF at fL xLi (t) xLi (t) + 2 cos 2fc t vq (t) LPF at fL xLq (t) xLq (t) cos 2fc t + sin 2fc t AM Modulators + x(t)

2 sin 2fc t AM Demodulators

The insight gained from this version is that conversion from x(t) to xL (t) is equivalent to AM demodulation with both a cosine and a (negative) sine carrier, whereas reconstruction of x(t) from xL (t) is equivalent to AM modulation, again with the same carriers. 3

Hilbert Transform. Yet another method to obtain the CLP representation xL (t) of the RBP signal x(t) makes use of the Hilbert transform xh (t) of x(t), which is dened as xh (t) = H{x(t)} = 1 x(t) t Xh (f ) = j sgn(f ) X (f ) .

Combining x(t) and jxh (t) yields the Fourier transform pair xu (t) = x(t) + j xh (t) where Xu (f ) = Xu (f ) = 1 + sgn(f ) X (f ) = 2u(f ) X (f ) , 2X (f ) , f > 0 , 0, otherwise .

Thus, xL (f ) is obtained by shifting Xu (f ) left by fc , as shown in the following blockdiagram.

x(t)

+ H{ . } xh (t) j + +

xu (t)

ej 2fc t

xL (t)

1.2

Quadrature Amplitude Modulation

A regular AM-DSB-SC signal with carrier frequency fc has the form x(t) = m(t) cos(2fc t) , where m(t) is the message signal, e.g., speech, music, or a PAM signal. But nothing speaks against using a sine carrier instead of a cosine carrier, and x (t) = m(t) sin(2fc t) , where the minus sign was used for consistency in notation but has no other fundamental meaning, is just as good an AM-DSB-SC signal as x(t). In fact, because sin(2fc t) and cos(2fc t) are orthogonal functions, x(t) and x (t) can be used simultaneously to generate a quadrature amplitude modulated (QAM) signal of the form x(t) = mi (t) cos(2fc t) mq (t) sin(2fc t) , where mi (t) is the in-phase message signal and mq (t) is the quadrature message signal. The block diagrams of a QAM modulator and a QAM demodulator are shown below.

mi (t)

cos 2fc t + x(t) r (t)

vi (t)

LPF at fL

m i (t)

2 cos 2fc t vq (t) LPF at fL m q (t)

mq (t)

sin 2fc t

2 sin 2fc t

Setting r(t) = x(t), the demodulator computes vi (t) = 2x(t) cos 2fc t = 2mi (t) cos2 2fc t 2mq (t) sin 2fc t cos 2fc t = mi (t) (1 + cos 4fc t) mq (t) sin 4fc t , vq (t) = 2x(t) sin 2fc t = 2mi (t) cos 2fc t sin 2fc t + 2mq (t) sin2 2fc t = mi (t) sin 4fc t + mq (t) (1 cos 4fc t) . Thus, after lowpass ltering at fL = fm , where fm fc is the highest message frequency, the in-phase and quadrature message signals mi (t) and mq (t) can be recovered independently of each other. Practical transmission systems rarely use QAM to directly transmit and receive two independent analog message signals mi (t) and mq (t). The main reason is the diculty to establish and maintain exact frequency and phase synchronization between transmitter and receiver. However, since any real bandpass signal x(t) can be regarded as a QAM signal with mi (t) = xLi (t) and mq (t) = xLq (t), where xL (t) = xLi (t) + j xLq (t) is the CLP representation of x(t), QAM can be used to generate (and demodulate) any AM, PM, or FM signal. Characteristic examples are given below. AM-DSB. For AM-DSB-SC with message signal m(t), carrier frequency fc , and carrier phase c , the transmitted real-valued bandpass signal is x(t) = m(t) cos(2fc t + c ) = m(t) cos c cos 2fc t m(t) sin c sin 2fc t . = mi (t) The corresponding complex-valued lowpass signal is thus xL (t) = mi (t) + j mq (t) = m(t) (cos c + j sin c ) . For AM-DSB-TC, simply replace m(t) by 1 + mn (t). PM/FM. For phase modulation with normalized message signal mn (t), maximum phase deviation , and carrier frequency fc , the transmitted real-valued bandpass signal is x(t) = cos 2fc t + mn (t) = cos( mn (t)) cos 2fc t sin( mn (t)) sin 2fc t . = mi (t) 5 = mq (t) = mq (t)

The complex-valued lowpass signal corresponding to x(t) is therefore xL (t) = mi (t) + j mq (t) = cos( mn (t)) + j sin( mn (t)) . For frequency modulation with maximum frequency deviation f , mi (t) and mq (t) become
t t

mi (t) = cos 2 f and thus

mn ( ) d ,
t

and

mq (t) = sin 2 f
t

mn ( ) d ,

xL (t) = cos 2 f

mn ( ) d + j sin 2 f

mn ( ) d .

1.3

General Bandpass Filters

Let h(t) be the unit impulse response of a real-valued bandpass lter (BPF) with real-valued input x(t) and real-valued output y (t) so that Dene the following complex-valued lowpass representations y(t): x(t): h(t): yL (t) = yLi (t) + j yLq (t) , xL (t) = xLi (t) + j xLq (t) , hL (t) = hLi (t) + j hLq (t) . y (t) = x(t) h(t) .

In complex-valued lowpass form the operation of the BPF can be described as yL (t) = xL (t) hL (t) = [xLi (t) + j xLq (t)] [hLi (t) + j hLq (t)] = [xLi (t) hLi (t) xLq (t) hLq (t)] +j [xLi (t) hLq (t) + xLq (t) hLi (t)] . = yLi (t) = yLq (t) A block diagram which implements this convolution and includes the translation from passband (around fc ) to baseband and vice versa is shown in the gure below.
xLi (t) hLi (t) + + hLq (t) yLi(t) cos 2fc t + + hLq (t) xLq (t) + hLi (t) + + yLq (t) +

2 cos 2fc t x(t)

y (t)

2 sin 2fc t

sin 2fc t

To determine hLi (t) HLi (f ) and hLq (t) HLq (f ) from h(t) H (f ), proceed as follows. Shift H (f ) to the left using some conveniently chosen fc . Then lowpass lter the result with an appropriate cuto frequency fL and multiply the result by 2. This yields the CLP representation HL (f ) hL (t). Then use HLi (f ) =
HL (f ) + HL (f ) , 2

and

HLq (f ) =

HL (f ) HL (f ) , 2j

to obtain the desired in-phase and quadrature components needed to implement the lter with real-valued hardware and/or software. Example: VSB/SSB Filter. To convert AM-DSB signals into AM-VSB-USB or AMSSB-USB signals, a BPF with the following ideal real-valued FT specication h(t) H (f ) can be used.
H (f ) 1 f 0 fL

fc fL fc fc fc +

0 fc

fc fc +

fc +fL

After shifting this spectrum to the left by fc , multiplying it by 2, and lowpass ltering it at fL , the following spectrum HL (f ) of the complex-valued lowpass representation hL (t) of the BPF is obtained.
HL (f ) 2 f 0 fL

fL

fL

Making use of hL (t) + h L (t) 2 hL (t) h L (t) hLq (t) = 2j hLi (t) = HLi (f ) =
HL (f ) + HL (f ) 2 HL (f ) HL (f ) H (f ) HL (f ) HLq (f ) = =j L 2j 2

yields the in-phase and quadrature component spectra of hL (t) shown in the next two graphs.
HLi (f ) 1 0 fL f

fL

fL

HLq (f ) j fL j fL

0 fL f

A convenient way to implement the BPF considered in this example is shown in the following blockdiagram.
2 cos 2fc t x(t) h2 (t) xLq (t) + + + sin 2fc t h1 (t) xLi (t) + + h2 (t) cos 2fc t + + +

y (t)

2 sin 2fc t

h1 (t)

In this blockdiagram hLi (t) = h1 (t) and hLq (t) = h1 (t) h2 (t), with h1 (t) and h2 (t) as given next.
H1 (f ) sin(2fL t) h1 (t) = t 1 fL 0 fL f

H2 (f ) fL j j fL f

h2 (t) =

1 sin(2 t) t 2 t

Now, if the lter input x(t) is an AM-DSB signal with carrier frequency fc fL , i.e., x(t) = m(t) cos(2fc t), then xLq (t) = 0 and therefore the block diagram of a AM-VSB-USB or AM-SSB-USB modulator can be reduced to the following. 8

m(t)

h1 (t)

mL (t)

+ cos 2fc t + + y (t)

h2 (t)

sin 2fc t

The benets of using this blockdiagram for implementing AM-VSB and AM-SSB modulation are that all ltering is done at baseband and can be implemented very precisely and maintenance-free using DSP chips, even if fc is several hundred MHz or a few GHz, as would be the case for cellular telephones or wireless LANs. O the shelf analog ICs exist for the implementation of the QAM modulator stage for such applications.

1.4

Filterless SSB Upconversion

Modern communication systems generally use digital signal processing (DSP) to generate signals that satisfy precise specications, largely independent of component tolerances and component aging. However, power, price, and availability considerations often necessitate the use of a lower carrier frequency fc1 at the output of the DSP than the nal carrier frequency fc2 . Typical values are fc1 1 . . . 20 MHz and fc2 1 . . . 5 GHz. One solution to convert a signal x(t) with carrier frequency fc1 at the ouput of a DSP system to an actually transmitted signal y (t) with carrier frequency fc2 , is to use a mixer as shown below in the form of a blockdiagram.
x(t) at fc1 v (t) BPF y (t) at fc2

2 cos 2 (fc2 fc1 )t

Because 2 cos 2fc1 t cos 2 (fc2 fc1 )t = cos 2 (fc2 2fc1 )t + cos 2fc2 t , a BPF is necessary to reject the signal at frequency fc2 2fc1 . If fc2 = 2 GHz and fc1 = 2 MHz, then the (analog) BPF needs to have a very narrow band, with a width of only about 2 MHz at 2 GHz, for the transition from passband to stopband. To avoid the need for such a BPF, the strategy outlined in the following blockdiagram can be used.

x(t) at fc1

+ H{ . } xh (t) j + +

xu (t)

w (t)

Re{ . }

y (t) at fc2

ej 2(fc2 fc1 )t

The Hilbert transform block computes xh (t) = H{x(t)} = and thus xu (t) = x(t) + j xh (t) Xu (f ) = 1 + sgn(f ) X (f ) = 2u(f ) X (f ) . 1 x(t) t Xh (f ) = j sgn(f ) X (f ) ,

That is, the complex-valued signal xu (t) has a spectrum that is zero for all f < 0. The multiplication with ej 2(fc2 fc1 )t then frequency-shifts that spectrum right by fc2 fc1 . Finally, after taking the real part of the result, a real bandpass signal y (t) at fc2 is obtained, without the additional signal at fc2 2fc1 . An implementation of this, using only real-valued signals and processing blocks, is shown in the blockdiagram below.
x(t) at fc1 + H{ . } 2 cos 2 (fc2fc1 )t xh (t) + + y (t) at fc2

2 sin 2 (fc2 fc1 )t

Implementing the Hilbert transform in analog hardware is quite non-trivial, but in a DSP chip it is fairly simple and straightforward. The QAM modulation with carrier frequency fc2 fc1 is usually done with analog hardware. To suppress signal components at fc2 2fc1 , it is crucial to maintain the 90 phase shift between the oscillators precisely, and to have all other characteristics between the in-phase and quadrature paths closely matched.

1.5

Zero IF Receivers

If digital signal processing is used at a receiver for AM, QAM, PM , or FM signals, then it is generally more ecient to work with complex lowpass signals than with real-valued bandpass signals at some intermediate frequency fIF , because in this way the sampling rate can be kept at a minimum. Thus, rather than using a conventional superheterodyne front 10

end and a IF amplier, modern communications receivers very often use a zero IF design, whereby the received signal is directly mixed down to baseband. However, in order to keep all processing options, such as extracting a carrier term for synchronization, or equalization for crosstalk between in-phase and quadrature signal components, open, both a sine and a cosine oscillator are used for the mixer. This corresponds to multiplying the received (real) signal r(t) by the complex exponential ej 2fc t , which just simply shifts the spectrum R(f ) to the left by fc . The general structure of a zero IF receiver is shown in the following block diagram.
2 cos 2fc t r (t) hLq (t) vq (t) vi (t) hLi (t) y1 (t)

hLq (t)

y2 (t)

y3 (t)

2 sin 2fc t

hLi (t)

y4 (t)

Most of the processing at the receiver is done by selecting the right lters hLi (t) and hLq (t), and then by taking linear combinations of their outputs y1 (t) . . . y4 (t). Both local oscillators are needed in most cases (including AM-DSB-SC), but not all four lters are needed in all cases. Example: AM-SSB-USB Zero IF Receiver. The blockdiagram below shows the operation of a zero IF receiver for AM-SSB-USB using complex-valued signal paths and complexvalued signal processing.
r (t) 2ej 2fc t v (t) HL (f ) m u (t) Re{.} m (t)

HL (f ) for USB
1

f
fm 0 fm

The (real-valued) signal r(t) is shifted left by fc in the frequency domain by multiplication with 2ej 2fc t . The resulting (complex-valued) signal v (t) is then lowpass ltered and, using the specic HL (f ) shown above, only the upper sideband is present in the (complex-valued) message signal m u (t). Taking the real part of this signal yields the (real-valued) received 11

message signal m (t). The next blockdiagram shows an implementation that uses only realvalued signal paths and real-valued processing blocks.
2 cos 2fc t r (t) hLq (t) vq (t) vi (t) hLi (t) y1 (t) + wired for SSB-USB + m (t)

hLq (t)

y2 (t)

y3 (t)

2 sin 2fc t

hLi (t)

y4 (t)

Finally, the Fourier transforms of the lters with (real-valued) impulse responses hLi (t) and hLq (t) are shown in the following two graphs.
HLi (f ) 1/2 fm f fm HLq (f ) j/2 0 fm fm

j/2

Lab Experiments

E1. QAM Modulation/Demodulation. (a) Implement the Matlab function qamxmtr for QAM modulation whose header is shown below.

12

function x = qamxmtr(t,mi,mq,fcparms,fmparms) %qamxmtr Qadrature Amplitude Modulation (QAM) Transmitter % >>>>> x = qamxmtr(t,mi,mq,fcparms,fmparms) <<<<< % where % x: transmitted QAM signal % t: time axis for mi(t), mq(t), x(t) % mi: (wideband) in-phase message signal to be modulated % mq: (wideband) quadrature message signal to be modulated % fcparms = [fc thetaei thetaeq] % fc: carrier frequency % thetaei: carrier phase error, in-phase (cos) oscillator % thetaeq: carrier phase error, quadrature (sin) oscillator % fmparms = [fm km alpham] LPF at fm parameters % no LPF at fm if fmparms = [] % fm: highest message frequency % km: LPF h(t) truncation to -km/2fm <= t <= km/2fm % alpham: LPF at fm frequency rolloff parameter, linear % rolloff over range 2*alpham*fm Test the qamxmtr function by generating x(t) from mi (t) = cos(2fmi t), fmi = 1000 Hz, and mq (t) = cos(2fmq t), fmq = 2000 Hz. Use Fs = 44100 Hz and fc = 4000 Hz and generate a signal of length 1 sec. Set the phase errors ei and eq to zero. Use showft to display the Fourier transform of x(t). What happens if you leave mi (t) unchanged, but use mq (t) = sin(2fmq t), fmq = 1000 Hz. Save the two QAM signals as myqam1001.wav and myqam1002.wav. (b) Implement the Matlab function qamrcvr for QAM demodulation whose header is shown below.

13

function [mihat,mqhat] = qamrcvr(t,r,fcparms,fmparms) %qamrcvr Quadrature Amplitude Modulation (QAM) Receiver % >>>>> [mihat,mqhat] = qamrcvr(t,r,fcparms,fmparms) <<<<< % where % mihat: demodulated in-phase message signal % mqhat: demodulated quadrature message signal % t: time axis for r(t), mihat(t), mqhat(t) % r: received QAM signal % fcparms = [fc thetaei thetaeq] % fc: carrier frequency % thetaei: in-phase (cos) local osc phase error % thetaeq: quadrature (sin) local osc phase error % fmparms = [fm km alpham] % no LPF at fm if fmparms = [] % fm: highest message frequency % km: LPF h(t) truncation to -km/2fm <= t <= km/2fm % alpham: LPF at fm frequency rolloff parameter, linear % rolloff over range 2*alpham*fm Use the QAM signals from part (a) to verify that the QAM demodulator works correctly. (c) Use the speech signal in speech1001.wav and the music signal in music1001.wav as inphase and quadrature message signals to generate a QAM signal x(t) with fc = 6000 Hz and fm = 4000 Hz. Set the phase errors ei and eq to zero. Save this signal as myqam1003.wav for later use. Then use the showpsd function to verify that the QAM signal indeed only occupies a bandwidth of about 8 kHz Next, use qamrcvr with the same fc = 6000 Hz and ei = eq = 0 to verify that mi (t) and mq (t) can be recovered independently and without interference from each other. Thus, as opposed to AM-DSB, no bandwidth expansion takes place when QAM is used. But how robust is QAM with respect to phase and frequency errors between transmitter and receiver? Test this by generating another QAM signal with the same parameters as above, except for setting the phase error eq = 10 , so that the sine and cosine carriers are now oset by 100 rather than 90 . Demodulate using the same phase error and check whether mi (t) and mq (t) can still be recovered without interference from each other. (d) Real-world bandpass channels are often not symmetric around the center or carrier frequency fc . How does that aect QAM signals? Use the trapfilt function to generate a lter with the frequency response shown below.

14

FT Approximation , F =44100 Hz, N=44100, =1 Hz


s f

1.4 1.2 1 |X(f)| 0.8 0.6 0.4 0.2 0 0 2000 4000 6000 f [Hz] 8000 10000 12000

Then pass the QAM signal in myqam1003.wav through the lter with the above frequency response and demodulate the received signal. Listen to mi (t) and mq (t) and describe the eect that the asymmetric lter has on each. E2. AM-VSB/SSB Generation with Baseband Filters. (a) The unit impulse response and the frequency response of an ideal CT Hilbert transform lter are given by h(t) = 1 t H (f ) = j sgn(f ) .

That is, the Hilbert transform leaves the magnitude of the input signal unchanged, but shifts the phase by 90 . Use the following Matlab code to generate h(t), sampled at rate Fs , and to look at its FT. Fs = 44100; t = [0:Fs-1]/Fs-1/2; h = zeros(size(t)); ix = find(t~=0); h(ix) = 1./(pi*t(ix)); showft(t,h,[-Fs/2 Fs/2 0]) %Sampling rate %Time axis %Unit impulse response

You should nd that the phase shift by 90 works well, but the magnitude of H (f ) is not equal to 1 for all f . However, changing h(t) to the following h (t) h (t) = and using the Matlab code Fs = 44100; %Sampling rate t = [0:Fs-1]/Fs-1/2; %Time axis h = zeros(size(t)); %Unit impulse response ix = find(t~=0); h(ix) = 1./(pi*t(ix)); h(ix) = h(ix)-cos(pi*Fs*t(ix))./(pi*t(ix)); showft(t,h,[-Fs/2 Fs/2 0]) 15 1 cos Fs t , t t

works very well. Can you explain why? Hint: Remember that Matlab (and DSP chips in general) can only work with DT signals that are derived from their CT counterparts by sampling at rate Fs (without violating the sampling theorem). (b) The Matlab function hilbfilt, whose header is given below, is used to implement the lter with impulse response 1 sin 2 t h2 (t) = , t 2 t which was derived in the introduction. When = 0, the lter computes the Hilbert transform of the input signal x(t). Using the results from part (a), use the following 1 sin 2 t cos Fs t , h2 (t) = t 2 t t instead of the original h2 (t) to complete hilbfilt. function y = hilbfilt(x,Fs,ord,delta) %hilbfilt Delay Compensated FIR Hilbert Transform Filter % (-90 deg Phase Shift) % >>>>> y = hilbfilt(x,Fs,ord,delta) <<<<< % where % y: filter output y(t), sampling rate Fs % x: filter input x(t), sampling rate Fs % Fs: sampling rate for x(t), y(t) % ord: filter order (must be even) % delta: linear transition region -delta<f<delta % % ^ H(f) % | % +--------------- + j +-- - % | \ | | % -Fs/2| \| delta | % ------+--------------+--+--+--------------+-------> f % | -delta |\ |Fs/2 % | | \ | % - - --+ -j + ---------------+ % | To test hilbfilt, use Fs = 44100; %Sampling rate ord = 300; %Filter order delta = 1000; %Transition band parameter t = [0:Fs-1]/Fs-1/2; %Time axis ui = zeros(size(t)); ui(1+Fs/2) = Fs; %Unit impulse at t=0; h2 = hilbfilt(ui,Fs,ord,delta); %Impulse response h(t) showft(t,h2,[-5000 5000 0]) 16

This should result in the following graphs for the magnitude (linear scale!) and the phase of the frequency response of the Hilbert lter.
FT Approximation , Fs=44100 Hz, N=44100, f=1 Hz 1.4 1.2 1 |X(f)| 0.8 0.6 0.4 0.2 0 5000 4000 3000 2000 1000 0 1000 2000 3000 4000 5000

200

100 X(f) [deg]

100

200 5000

4000

3000

2000

1000

0 f [Hz]

1000

2000

3000

4000

5000

(c) Use the lter functions trapfilt and hilbfilt to implement the AM transmitter function amxmtr30 whose description is shown below. It uses the idea of complex lowpass ltering to generate AM-VSB and AM-SSB signals with selectable LSB or USB and selectable transition region . . . , 0 fm , for AM-VSB.

17

function x = amxmtr30(t,m,xtype,fcparms,fmparms,hLparms) %amxmtr30 Amplitude Modulation Transmitter, V3.0 % Uses complex lowpass shaping with hL(t)=hLi(t)+j*hLq(t) % for AM-VSB/SSB filtering % >>>>> x = amxmtr30(t,m,xtype,fcparms,fmparms,hLparms) <<<<< % where % x: transmitted AM signal % t: time axis for m(t), x(t) % m: (wideband) message signal to be modulated % xtype: amplitude modulation transmitter type from list % {amdsbsc,amdsbtc,amssbsc,amvsbsc} % fcparms = [fc thetac] for {amdsbsc,amssbsc,amvsbsc} % fcparms = [fc thetac alpha] for {amdsbtc} % fc: carrier frequency % thetac: carrier phase in deg (0: cos, -90: sin) % alpha: modulation index 0<=alpha<=1 % fmparms = [fm km alpham] LPF at fm parameters % no LPF at fm if fmparms = [] % fm: highest message frequency % km: LPF h(t) truncation to -km/2fm <= t <= km/2fm % alpham: LPF at fm frequency rolloff parameter, linear % rolloff over range 2*alpham*fm % hLparms = [sb ordL delta] for {amssbsc,amvsbsc} % (use small delta for amssbsc) % sb: sideband (sb=-1 LSB, sb=+1 USB) % ordL: order of hL filter (ordL = length(hL)-1) % delta: frequency rolloff fc-delta to fc+delta Test amxmtr30 by generating a AM-VSB-USB-SC, a AM-VSB-LSB-SC, a AM-SSB-USB-SC, and a AM-SSB-LSB-SC signal with fc = 6000 Hz and Fs = 44100 Hz from the (increasing) chirp signal in chirp1001.wav. Assume fm = 3000, use = 1000 Hz and ordL 200 for the AM-VSB signals, and = 50 Hz and ordL 1000 for the AM-SSB signals. Use showpsd to check the spectrum of the four signals for correctness. (d) Use amxmtr30 and the signals in chirp1001.wav (chirp with increasing frequency) and chirp1002.wav (chirp with decreasing frequency) to generate a AM-SSB-USB-SC and a AM-SSB-LSB-SC signal, respectively, with Fs = 44100 Hz at fc = 6000 Hz. Add the two signals to obtain a AM-DSB-SC signal whose upper and lower sidebands carry dierent message signals. Save this signal as myam1004.wav for later use. (e) Use the idea of lterless SSB upconversion to shift the QAM signal that you saved in myqam1003.wav from a carrier frequency of fc1 = 6000 Hz to a carrier frequency of fc2 = 7000 Hz. Verify the integrity of this signal by demodulating it using qamrcvr. How does this operation of shifting the spectrum of a QAM signal (or any real bandpass signal) dier from using a mixer that would multiply the QAM signal with a local oscillator at frequency fx = fc2 fc1 ? 18

E3. Zero IF Receiver. (Experiment for ECEN 5002, optional for ECEN 4652) (a) Use the following blockdiagram as a basis for an AM receiver that can be used to receive AM-DSB, and AM-SSB signals, with a provision to select either the LSB or the USB.
2 cos 2fc t r (t) hLq (t) vq (t) vi (t) hLi (t) y1 (t)

hLq (t)

y2 (t)

y3 (t)

2 sin 2fc t

hLi (t)

y4 (t)

To demodulate an AM-DSB-SC signal, the output y1 (t) can be used directly. To demodulate AM-SSB-SC signals, a linear combination (either sum or dierence) of y1 (t) and y3 (t) is used. The header of this zero-IF AM receiver with complex lowpass ltering, called amrcvr30, looks as follows

19

function mhat = amrcvr30(t,r,rtype,fcparms,fmparms,hLparms) %amrcvr30 Amplitude Modulation Receiver, V3.0 % Zero-IF receiver with complex lowpass filtering % using hL(t)=hLi(t)+j*hLq(t) % >>>>> mhat = amrcvr30(t,r,rtype,fcparms,fmparms,hLparms) <<<<< % where % mhat: demodulated message signal % t: time axis for r(t), mhat(t) % r: received AM signal % rtype: amplitude modulation receiver type from list % {amdsbsc,amssbsc,amvsbsc} % fcparms = [fc thetac] for {amdsbsc,amssbsc,amvsbsc} % fc: carrier frequency % thetac: carrier phase in deg (0: cos, -90: sin) % fmparms = [fm km alpham] LPF at fm parameters % no LPF at fm if fmparms = [] % fm: highest message frequency % km: LPF h(t) truncation to -km/2fm <= t <= km/2fm % alpham: LPF at fm frequency rolloff parameter, linear % rolloff over range 2*alpham*fm % hLparms = [sb ordL delta] for {amssbsc,amvsbsc} % (use small delta for amssbsc) % sb: sideband (sb=-1 LSB, sb=+1 USB) % ordL: order of hL filter (ordL = length(hL)-1) % delta: frequency rolloff fc-delta to fc+delta Test the receiver using the signal you saved earlier in myam1004.wav (AM signal with dierent chirp signals in the LSB and USB). (b) Analyze the signals in the wav-les amsig1002.wav and amsig1003.wav. The rst signal is an AM-DSB-SC signal with one of the sidebands jammed. The second signal consists of a set of frequency division multiplexed AM-SSB-SC signals with carrier frequencies fc1 = 2000 Hz, fc2 = 5500 Hz, fc3 = 9000 Hz, fc4 = 12500 Hz, and fc5 = 16000 Hz. Demodulate all message signals with as little noise and crossinterference as possible, using amrcvr30

c 20002013, P. Mathys.

Last revised: 3-20-13, PM.

20

Вам также может понравиться