Dear group,

I am trying to understand how to detect multipath signals? I have 2 rx antenna and distance between rx1 and rx2 is 10 cm and they are fixed. The digital TV station is 4 km away from 2 rx antennas.

Assume 2 rx antennas are static in the same location. We also can assume the most simplest cases, these are: only direct signal and no multipath, or direct signal and only 1 multipath.

Here is also my images with my question and what I am trying to do? (attached file)

I also purchase the ebook from gaussianwaves.com “SIMULATION OF DIGITAL COMMUNICATION SYSTEMS USING MATLAB” by Mathuranathan Viswanathan which instructed me to understand with multipath but I thought not the one with my situation.

I also found the pdf file online, which is almost close to what I am researching. please look at this link: http://m.eet.com/media/1116127/mcclaning_3_pt2.pdf

If anyone who has been working on this Multipath, please share experience with me.

Thank you so much.

I will give you a brief idea on what to do. The idea is for generating samples for static condition (no randomness built in the filter).

Lets say you have two static rays. One direct ray and another reflected ray. The direct ray is taken as reference hence assign 0 dBm power to it. The reflected ray is considered as weak and assign say -5 dBm to it. (If you are unfamiliar with about dBm notations, just google it)

Assume that the reflected ray arrives at the receiver, say tau seconds after the direct ray.

This can be represented as a filter model shown below. I will explain a_0 and a_1 in the figure. They are called filter taps in signal processing jargon. Just read on.

When we plot this information, we get what is called ‘Power delay profile (More details here). For the case here, we will have two vertical lines one at 0 seconds with 0 dBm power and another at say tau seconds with -5 dBm power.

>>p_dBm = [0 -5];

%direct ray with 0 dBm power

%reflected ray with -5 dBm relative power

Convert the power from dBm to linear scale

>>p = 10.^(p_dBm/10);

Take square root of the power to represent voltages.

>>a = sqrt(p);

Here we will have two voltages, one for the direct ray and another for the reflected ray.

We need to normalize the tap gains (a_0 and a_1 in the diagram above) so that it properly represents the power level in the power delay profile.

>> taps = 1/sqrt(sum(p))*a; %this becomes the normalized filter taps

Now, generate a impulse signal as input to the model.

>>input_signal = [ 0 0 0 1 0 0 0]; %impulse signal to test

Send the input signal through the filter model with the taps above

>>received_signal = filter(taps,1,input_signal)

The filter model assumes that all taps are spaced tau seconds apart. You dont have to explicitly specify in the code.

That is the procedure for generating a static model. You can stop here if this is what you need. Or else, you can introduce randomness in the filter taps as shown in the diagram below, where alpha and phi are all random variables as explained in one of my previous reply.

In this time varying model, the power delay profile varies from time to time (you still have two spikes in the graph and but they will vary from time to time) and we have a linear time-varying filter model to implement.

You can check dsp filter blocks to know how to do this.

Hope this sheds some clarity.

@Mathuranathan : I am sorry to take you to go big circle, now come back with the starting point, it means back to the rayleigh_fading theory.

Assume we have this code, and truth for my case, I would like to have these value base on the code from your book, such as: (please look at my commands after the sign of % with highlight)

fc = 533e6; %**carrier frequency (MHz)**

M = 1; %number of multipaths –> **my case have only 1 Direct signal and 1 multipath** %**signal**

N = 10^6; %number of samples to generate –> **What does it mean?**

fd = 100; %Maximum doppler spread in hertz –> **what happen if I change fd = 0 because **% **I do** **not have doppler effect in static motion?**

Ts = 1/fc; %Sampling period in seconds

a = 0; % the range from 0 to 2pi for a and b.

b = 2*pi;

alpha = a + (b – a) * rand(1, M); %uniformly distributed from 0 to 2 pi

alpha = a + (b – a) * rand(1, M); %uniformly distributed from 0 to 2 pi

theta = a + (b – a) * rand(1, M); %uniformly distributed from 0 to 2 pi

**% Are alpha, alpha, theta random angle between 0 and 2pi ? If not, what are those **

**% angles presence for?**

**% If so, why I do not see any relationship between them?**

m = 1 : M; % number of the multipath.

for n = 1:N;

x = cos(((2.*m-1)*pi + theta)/(4*M)); % **Is this a direct signal? If not, what x stand for?**

h_re(n) = 1/sqrt(M)*sum(cos(2* pi* fd *x *n *Ts + alpha)); % **If fd = 0 (no doppler effect occurs) cos value is now depend only on alpha, is it right?**

h_im(n) = 1/sqrt(M)*sum(sin(2* pi* fd *x *n *Ts + beta)); % **If fd = 0 (no doppler effect occurs) sin value is now depend only on beta, is it right?**

end

h = h_re + j*h_im;

h_re = real(h);

h_im = imag(h);

% and so on, I think you will remember what are next, but I will send the rest of code to your email, Please take couple minutes to help me explain and see my case. I hope you are not asking me to read this part again in the book, because I read couple times but I still not digest it, it is really new technology for me to learn, I will open to receive any suggestion from you.

% Thank you very much for your time.

% Very best regards,

% Nate Duong.

It is best to view multipath signal in time domain rather than in frequency domain.

In time domain, you should see fading signatures (signal dropping below a threshold) like the one below

To simulate such signatures the parameters (rho) and (phi) (in the following equation) should be a random variable.

From your code, I see that there is no random component built in the signal. That is why you observe a small spike in the frequency domain.

To check, plot the signal in time domain and look for evidences of fading.

I would suggest using the two-ray Rayleigh fading model to begin with. It is very similar to what you are intending to do. Here it is

For choose a simple test signal like an impulse signal for the input

input = [0 0 0 0 0 1 0 0 0 0]; %example for impulse signal

(alpha_1) and (alpha_2) should be drawn as independent rayleigh distributed numbers and (phi_1) and (phi_2) are drawn from uniform distribution in the range ([0,2 pi] )

My ebook has included the simplest case of generating flat fading using Clarke model. Please see how it is implemented. View the post here

Just extend that to the two-ray model as shown in the diagram above.

ops, wrong code, they are supposed to be:

%% 1 multipath signal and 1 direct signal.

clear all,%close all,

fc = 533e6;

c = 3e8;

lamda = c/fc;

k = 2*pi/lamda;

d = 0.1;

x = d/2;

a0 = 1;

w = 2*pi*fc;

t = 0: 0.001e-9 : 10e-9;

f_s = 8e6;

t_0 = 1 / fc;

r_0 = t_0 / (2 * pi);

nfft = 256;

navg = 1024;

f = ((0:(nfft – 1)) / (nfft – 1) – 0.5) * f_s;

nsamps = navg * nfft;

delay = 0;

alpha = 0;

summ1 = (1+cos(k*x*cos(alpha)))*(cos(w*(t-delay)) + j*sin(w*(t-delay)));

delay = 10e-9;

alpha = pi/2;

summ2 = (1+cos(k*x*cos(alpha)))*(cos(w*(t-delay)) + j*sin(w*(t-delay)));

% figure, plot(t,real(summ1)) %,…

% figure, plot(t,real(summ2))

% figure, plot(t,real(summ3))

% figure, plot(t,real(summ4))

% t,real(summ2),…

% t,real(summ3),…

% t,real(summ4),…

% t,real(summ5))

%legend(‘sum1′,’sum2′,’sum3′,’sum4′,’sum5′)

w = hann(nfft).’;

cxy = zeros(1, nfft);

for j = 1: 39

mm = (j – 1) * nfft + (1:nfft);

fx = fft(summ1(mm) .* w); % 2^15

fy = fft(summ2(mm) .* w);

cxy = cxy + fftshift(fx .* conj(fy));

if 1

figure(1);

plot(f, 10 * log10(abs(cxy)));

xlabel(‘Frequency (Hz)’);

ylabel(‘Power (dB)’);

title(‘absolute value’);

figure(2);

plot(f, angle(cxy) * r_0 * 1e12); % in pico second

xlabel(‘Frequency (Hz)’);

ylabel(‘Phase (ps)’);

title(‘angle’);

end

pause(0.5)

end

@Mathuranathan: I am still trying to understand it.

Again, this is a signal from the digital tv transmitter or digital tv station, after collecting data and process with multipaths included, it will give us these plots for the phase and magnitude (look at the attached files with the name abs_original.jpg and phase_original.jpg)

Now, I am assuming there are only 1 direct signal and 1 multipath. The observations and expectations are similar to the original (plots), from there I can see something and experience to detect multipath signal. Is it right? (you can look at my code file which is also attached).

%% 1 multipath signal and 1 direct signal.

clear all,%close all,

fc = 533e6;

c = 3e8;

lamda = c/fc;

k = 2*pi/lamda;

d = 0.1;

x = d/2;

a0 = 1;

w = 2*pi*fc;

t = 0: 0.001e-9 : 10e-9;

f_s = 8e6;

t_0 = 1 / fc;

r_0 = t_0 / (2 * pi);

nfft = 256;

navg = 1024;

w = hann(nfft).’;

f = ((0:(nfft – 1)) / (nfft – 1) – 0.5) * f_s;

nsamps = navg * nfft;

delay = 0;

alpha = 0;

summ1 = (1+cos(k*x*cos(alpha)))*(cos(w*(t-delay)) + j*sin(w*(t-delay)));

delay = 10e-9;

alpha = pi/2;

summ2 = (1+cos(k*x*cos(alpha)))*(cos(w*(t-delay)) + j*sin(w*(t-delay)));

% figure, plot(t,real(summ1)) %,…

% figure, plot(t,real(summ2))

% figure, plot(t,real(summ3))

% figure, plot(t,real(summ4))

% t,real(summ2),…

% t,real(summ3),…

% t,real(summ4),…

% t,real(summ5))

%legend(‘sum1′,’sum2′,’sum3′,’sum4′,’sum5’)

cxy = zeros(1, nfft);

for j = 1: 39

mm = (j – 1) * nfft + (1:nfft);

fx = fft(summ1(mm) .* w); % 2^15

fy = fft(summ2(mm) .* w);

cxy = cxy + fftshift(fx .* conj(fy));

if 1

figure(1);

plot(f, 10 * log10(abs(cxy)));

xlabel(‘Frequency (Hz)’);

ylabel(‘Power (dB)’);

title(‘absolute value’);

figure(2);

plot(f, angle(cxy) * r_0 * 1e12);

xlabel(‘Frequency (Hz)’);

ylabel(‘Phase (ps)’);

title(‘angle’);

end

pause(0.5)

end