Matlab Summation equation for calculating impulse response of FBMC

9 visualizaciones (últimos 30 días)
Hello guys,
I am trying to solve this equation to calculate the impulse response of a filter bank carrier but the graph is not exactly same to what i should get.
Kindly help!
M = 64; %Number of subcarriers
K = 4; %overlapping factor
y=[1 0.97195983 sqrt(2)/2 0.23514695 ]
T= M;
t = linspace (0,100,100)
for k = 1:3
result =(y(1,1)^2* cos(2*pi*k*t/(K*T)) + y(1,2)^2*cos(2*pi*k*t/(K*T))+ y(1,3)^2* cos(2*pi*k*t/(K*T)+ y(1,4)^2* cos(2*pi*k*t/(K*T))));
k
end
result = 1+2*result
plot (result)

Respuesta aceptada

AJAY CHANDRA DORAGARI
AJAY CHANDRA DORAGARI el 8 de Ag. de 2020
Editada: AJAY CHANDRA DORAGARI el 8 de Ag. de 2020
i understand that you are trying to add harmonics (fundamental upto third ) by computing harmonics at some instants of time and trying to get plot of it
M = 64; %Number of subcarriers
K = 4; %overlapping factor
y=[1 0.97195983 sqrt(2)/2 0.23514695 ]
T= M;
l=K*T; % simplify the equation instead of typing it every time
for k=1:3
for t=0:100
h(k,t+1)=((y(1)^2)*cos((2*k*pi*t)/l))+((y(2)^2)*cos((2*k*pi*t)/l))+((y(3)^2)*cos((2*k*pi*t)/l))+((y(4)^2)*cos((2*k*pi*t)/l))
%here im using t+1 because t=0 cannot be used since indexing must be a positve non zero interger i could use logic(t) but im too lazy
end
end
a=1+(2*sum(h))
plot(a)
xlabel('h(t)')
ylabel('t')
is this the graph you are expecting?
even code can be improved
  40 comentarios
Sara Nasir
Sara Nasir el 9 de Ag. de 2020
Can you go through the code please!
There is no error now but nothing on graph.
M = 64; %Number of subcarriers
K = 4; %overlapping factor
H0=1;
H1=0.97195983;
H2=sqrt(2)/2;
H3=0.23514695;
H4=-0.97195983;
H5=-sqrt(2)/2;
H6=-0.23514695;
a=M*K;
f=-1/M:0.001:1/M;
for k=-3:3
for f=-1/M:0.001:1/M
b = f-k/a;
Num = sin(pi*(b)*a);
Den = a* sin(pi*(b));
product=Num./Den;
H = H6*product + H5*product + H4*product + H3*product + H2*product + H1*product + H0*product;
end
end
ab=1+(2*sum(H))
figure(1)
plot (ab)
xlabel('f')
ylabel('H(f)')
AJAY CHANDRA DORAGARI
AJAY CHANDRA DORAGARI el 10 de Ag. de 2020
i have a doubt
H-1 and H1 are both same the terms used in the frequency response formula
ill try to write my own code first then ill see your code

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by