- The Hilbert transform is a filter with frequency
response given by
The corresponding impulse response is
- The preceeding formulas are for continuous-time
Hilbert transformers. The discrete time Hilbert transform
has a frequency response given by
The corresponding impulse response is
- Unfortunately this impulse response is noncausal
and infinite in duration. A realizable Hilbert transformer
can be obtained by truncating the impulse response and then inserting
a delay to make it causal. This leads to a filter that only approximates
the response of a Hilbert transformer. (A windowing function
may also be applied to reduce spectral leakage.) The following
is a bit of Matlab code that leads to a discrete-time Hilbert transformer.
% Windowed Hilbert transformer design.
N = 15;
h = (2/pi)*sin(pi*[-N:N]/2).^2./[-N:-1,1,1:N];
Below are three plots. The first is a plot of the impulse response
of the Hilbert Transformer (time-domain). The next two plots are in
the frequency domain. There is a magnitude plot and a phase plot.
Do these match the expected frequency response of the discrete-time
Hilbert Transformer above?
If you try to reproduce the spectrum plots using the FFT function in
Matlab, the resulting phase plot will probably look like a straight
line sloping down. The downward slope is due to a linear phase term
introduced in the frequency domain because of the time delay of the impulse
response in the time domain. Don't worry if you can't reporduce these
plots exactly. You have not learned how to properly use the FFT function
yet.
- An easier way to design a Hilbert transformer is using Matlab's
remez function.
%
Remez Hilbert transformer design.
L = 31;
h = remez(L-1,[.1 .9],[1 1],'Hilbert');
- To test the Hilbert transformer, download
the file x.mat into your working directory
and load it into the Matlab workspace by typing the following at the
Matlab prompt.
load x
- This will load a variable called x
into the Matlab workspace. Filter x with your Hilbert
transformer by typing the following at the Matlab prompt.
xp=filter(h,1,x);
- By looking at the plots from above, you can
see that the hilbert transformer has a delay of 15 taps. In order
to keep x and xp
synchronized, we need to delay x by the same amount.
An easy way to do this is using a delay filter as follows.
L = 31;
delayfilter = zeros(L,1).';
delayfilter(16) = 1;
x = filter(delayfilter,1,x);
- Next we want to plot the real and imaginary parts of the
spectrum of xp. To do this,
modify the spectrum function that you wrote for Lab 1 to plot
the real and imaginary parts of the spectrum instead of just the
magnitude. Here's some example code that you may want to
try: sigspec.m. (Note: This is a new and improved version of the sigspec.m
function from Lab 1.)
- Using your new and improved spectrum function,
plot the real and imaginary parts of the spectra of x
and xp. Write
a description of the two spectra. Do they appear as you expected?
Does the spectra of xp look like the spectra
of x
multiplied by the response of the Hilbert Transformer? Is the real
part an even function and the imaginary part an odd function? Here's
what my plots look like.
- Plot the magnitude (linear not dB scale) and phase of the
spectra of x+j*xp. Compare
it with the magnitude (linear not dB scale) spectra of x
by itself. What are the differences? The signal x+j*xp
should be zero for negative frequencies and look like x
at positive frequencies. Is this the case? What degredations
do you see? Here's what my plots look like. The red line is
the spectrum of x and the blue line
is the spectrum of x+j*xp.
- Also plot the magnitude and phase spectrum
of the Hilbert transformer h. Write a description
of this spectra. Is the actual spectrum close to the expected
spectrum. What was the effect of truncating the infinte length
impulse response and inserting a delay to make it causal?
- Turn in to the Lab TA: (1) the spectrum plots of x
and xp,
(2) the spectrum plots of the Hilbert transformer, (3) the spectral plots
of x+j*xp
and x,
(4) all of the written descriptions. Clearly lable plots.
- Now that we have a little experience with
Hilbert transforms, we are ready to move on two single sideband
modulation.