discrete baseband channel model

22 visualizzazioni (ultimi 30 giorni)
Jose Iglesias
Jose Iglesias il 8 Mar 2023
Commentato: Jose Iglesias il 16 Mar 2023
Creating Matlab code for the following problem statement shown below. This is for a discrete baseband channel model lth (complex) channel filter tap. There is an iteration for the gains (a) and the delays (tau) and their values are shown below in the Matlab code that needs revising. I want it to run through each value of a and tau from the first to the last for the iteration.I need help tweaking the code so it can plot the amplitude of the channel model vs l. The Matlab code that needs revising is shown below. The bandwith is 200 kHz.Thank you in advance.
% Define the range of l values
l = -5:5;
f = 100000;
W = 200E3;
tau = [.2387 4E-6 3.40E-6 3.667E-6 3.59E-6];
a = [.2387 -.2 -.2341 -.217 -.222];
a*b = a(i)*exp*(-i*2*pi*f*tau(i));
% Compute the discrete baseband channel model h
h = zeros(size(l));
for idx = 1:length(l)
for i = 1:length(a)
h(idx) = h(idx) + (1i*a(i)*b(i)/W)*sinc(l(idx)-tau(i)*W);
end
end
% Plot the amplitude of h vs l
stem(l, abs(h));
xlabel('l');
ylabel('|h_l|');
title('Amplitude of the Discrete Baseband Channel Model');

Risposta accettata

Zuber
Zuber il 15 Mar 2023
Hi,
I understand that you want to plot the amplitude of the channel model vs l. In the code, the variable a*b’ is not a valid variable name, and is replaced by ‘a_b’ in the code below. The definition of a*b’ accesses the index of vector ‘a’ and ‘tau’, so it should be inside the for loop. Also, the code for h(idx) is not as per the definition of ’. Following code can be used to get the correct ‘a_b’ and ‘h’ values : -
for idx = 1:length(l)
for i = 1:length(a)
a_b = a(i)*exp(-1i*2*pi*f*tau(i));
h(idx) = h(idx) + (a_b*(idx/W)*sinc(l(idx)-tau(i)*(idx/W)*W));
end
end
I hope this resolves your query.

Più risposte (0)

Prodotti


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by