0% found this document useful (0 votes)
63 views

Envelope Detection Using MATLAB For Any Time Domain Signal (Thorugh Hilbert Transform)

The document discusses envelope detection of amplitude modulated signals using the Hilbert transform in MATLAB. It explains that the Hilbert transform can be used to efficiently calculate the envelope of a signal. It provides an example MATLAB code that generates an amplitude modulated signal, applies the Hilbert transform to calculate the envelope, and plots the original signal and extracted envelope for comparison. The code shows how the Hilbert transform can be used to demodulate an amplitude modulated signal and extract the original message signal.

Uploaded by

Saman fatima
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Envelope Detection Using MATLAB For Any Time Domain Signal (Thorugh Hilbert Transform)

The document discusses envelope detection of amplitude modulated signals using the Hilbert transform in MATLAB. It explains that the Hilbert transform can be used to efficiently calculate the envelope of a signal. It provides an example MATLAB code that generates an amplitude modulated signal, applies the Hilbert transform to calculate the envelope, and plots the original signal and extracted envelope for comparison. The code shows how the Hilbert transform can be used to demodulate an amplitude modulated signal and extract the original message signal.

Uploaded by

Saman fatima
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Envelope Detection Using MATLAB for Any time Domain Signal (Thorugh Hilbert

Transform)

The above diagram/plot is of an Amplitude Modulated wave, & we have just found its envelope. This was
the result of one of the MATHWORK'S example in simulink to demodulate the AM signal. Electronically
envelope detector is a very simple circuit, consisting of a diode, resistor & capacitor. From ages it has
been used to De-modulate the amplitude modulated signals, on the receiver side. The output of the circuit
is approximately a voltage-shifted version of the original baseband signal. A simple filter (like a
capacitor) can be used to filter out the DC component. In order to get the desired amplitude variation.
That was a little about the circuit implementation of Envelope Detector, but how through a MATLAB
code we are going to implement the envelope detection?
The answer lies hidden in the Hilbert Transform. It been a very common and efficient technique for
envelope detection. The Hilbert transform is typically implemented as an FIR filter so the original signal
must be delayed to match the group delay of the Hilbert transform. This process can be followed by
absolute and then peak hold functions. Another option for detecting the envelope is to use the square root
of the energies of the original and the Hilbert transformed signals, as follows :

Envelope = sqrt(Hilbert^2 + signal^2)

In general, this will give similar results to the absolute value technique but can be more run-time efficient.
So, in order to do it, in MATLAB just the simplest way to add this line after the signal of which the
envelope has to be calculated.

envelope = abs(hilbert(Signal));

We will show with the help of example,

Demodulating the AM Signal, using Envelope Detection through MATLAB.

clc;

clear all;

close all;

Ac=2; %carrier amplitude

fc=0.5; %carrier frequency

Am=.5; %message signal amplitude

fm=.05; %message signal frequency

Fs=100; %sampling rate/frequency

ka=1; %modulation coefficient


t=[0:0.1:100]; defining the time range & disseminating it into samples

ct=Ac*cos(2*pi*fc*t); %defining the carrier signal wave

mt=Am*cos(2*pi*fm*t); %defining the message signal

AM=ct.*(1+ka*mt); %Amplitude Modulated wave, according to the standard definition

plot(AM, 'b');

hold on;

envelope = abs(hilbert(AM)); % hilbert transform to calculate the envelope of the signal

plot(envelope, 'r');

hold off

Another similar result we have obtained by applying it to a product of exponential & cosine signal. The
code & result as follows:

clc;

clear all;

close all;

Ac=2; %carrier amplitude


fc=0.5; %carrier frequency

Am=3.5; %message signal amplitude

fm=.05; %message signal frequency

Fs=100; %sampling rate/frequency

ka=1; %modulation coefficient

t=[0:0.1:100]; %defining the time range & disseminating it into samples

ct=Ac*cos(2*pi*fc*t); %defining the carrier signal wave

mt=Am*exp(t); %defining the message signal

AM=ct.*mt; %Amplitude Modulated wave, according to the standard definition

plot(AM, 'b');

hold on;

envelope = abs(hilbert(AM)); % hilbert transform to calculate the envelope of the signal

plot(envelope, 'r');

hold off

The result is:

Technique-2

Envelope Detection Using MATLAB for Any time Domain Signal (Thorugh Hilbert Transform)

% Modulation Process
Fc = 20; % carrier frequency of 20 kHz

Fs = 160; % sampling rate of 160 samples per ms

Fm = 0.4; % modulating frequency of 0.4 kHz

t = 0:1/Fs:10; % t of 10 seconds

c = cos(2*pi*Fc*t); % carrier signal

m = cos(2*pi*Fm*t); % modulating signal

s = c + 0.25*cos(2*pi*(Fc+Fm)*t) + 0.25*cos(2*pi*(Fc-Fm)*t); % FCAM 50% mod

dsb_sc = ammod(m,Fc,Fs); % DSB-SC signal

figure;

subplot(4,1,1);

plot(t, m);

title('Modulating Signal'); xlabel('time (s)'); ylabel('amplitude');

subplot(4,1,2);

plot(t, c);

title('Carrier Signal'); xlabel('time (s)'); ylabel('amplitude');

subplot(4,1,3);

plot(t, s);

title('FCAM Signal'); xlabel('time (s)'); ylabel('amplitude');

subplot(4,1,4);

plot(t, dsb_sc);

title('DSB-SC Signal'); xlabel('time (s)'); ylabel('amplitude');

% Non-Coherent Detection Step 1: Envelope Detection

Vc(1) = 0; % initial capacitor voltage

for i = 2:length(s)

if s(i) > Vc(i-1) % diode on (charging)


Vc(i) = s(i);

else % diode off (discharging)

Vc(i) = Vc(i-1) - 0.023*Vc(i-1);

end

end

Vd(1) = 0;

for i = 2:length(dsb_sc)

if dsb_sc(i) > Vd(i-1) % diode on (charging)

Vd(i) = dsb_sc(i);

else % diode off (discharging)

Vd(i) = Vd(i-1) - 0.023*Vd(i-1);

end

end

% Non-Coherent Detection Step 2: Low Pass RC Filter

h = fir1(100, 0.0125, 'low'); % 1 kHz cut-off frequency

foutputc = filter(h,1,Vc);

figure;

subplot(3,1,1);

plot(t, Vc);

title('Envelope detector output of FCAM signal'); xlabel('time (s)'); ylabel('amplitude');

subplot(3,1,2);

plot(t, Vd);

title('Envelope detector output of DSB-SC signal'); xlabel('time (s)'); ylabel('amplitude');

subplot(3,1,3);

plot(t, foutputc);

title('Non-coherent demodulated FCAM signal'); xlabel('time (s)'); ylabel('amplitude');

You might also like