
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Matlab Summation equation for calculating impulse response of FBMC
조회 수: 5 (최근 30일)
이전 댓글 표시
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)

채택된 답변
AJAY CHANDRA DORAGARI
2020년 8월 8일
편집: AJAY CHANDRA DORAGARI
2020년 8월 8일
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
AJAY CHANDRA DORAGARI
2020년 8월 8일
편집: AJAY CHANDRA DORAGARI
2020년 8월 8일
i would even like to know whether you are trying to get discrete or a continous one
i assumed that to be continous time function
since you have specified it as a function of 't' rather than 'n'
Sara Nasir
2020년 8월 9일
Hello Ajay,
I am trying to plot the prototype filter in time and frequency domain for which I have to solve the respective formulas. I am just starting of with Matlab coding since it is the part of my project. The graph I should get is something like this.

AJAY CHANDRA DORAGARI
2020년 8월 9일
편집: AJAY CHANDRA DORAGARI
2020년 8월 9일
I could try if you could attach a file about prototype filter and the mathematical relations about response you want sorry im not an electronics and communications student iam an electrical student but I had a subject signals and systems in my course,so I can try it.I tried searching about prototype filter but couldnt understand the terms associated with the formula.If you could explain the terms I can help you to write the code
Sara Nasir
2020년 8월 9일
okay Ajay I have to plot the frequency response and the impulse response which I am trying to get but the graphs are a little bit different from what is expected.
I have to plot h(t) and H(f) in the chapter 3 of the paper.
Sara Nasir
2020년 8월 9일
Chapter 3 is the topic. This filter known as PHYDYAS filter. I have simulate it in time and frequency domain (in Matlab) using the formulas given for K=overlapping factor=4, M= number of subcarrier = 64 to reproduce figure 6 and Figure 7 . For this I have to use formula of h2(t) and H2(f) in page number 10.
AJAY CHANDRA DORAGARI
2020년 8월 9일
편집: AJAY CHANDRA DORAGARI
2020년 8월 9일
i have a doubt consider the h(0) instant calculate the value at h(0)
substituting t=0 and k=1,2,3 as per the given formula
h(0)=1+2*(H1*cos(2*pi*0)+H2*cos(4*pi*0)+H3*cos(6*pi*0))
this would be h(0)=1+2(h1+h2+h3)=approx 7
nd in the time response it is given as amplitude =0 at t=0 instant
AJAY CHANDRA DORAGARI
2020년 8월 9일
h(0) calculated manually and h(0) in the graph must match if not the formula or the graph or our interpretation of formula must be wrong
tell me Hk in formula are the values given in the table 1 of page 7 ?
and the value of T is M?
Sara Nasir
2020년 8월 9일
yes the values are from table 1 on page 7.
K=4 and M=64
T is the duration of multicarrier symbol and it is M.
I can also share two forums on which code is given but the formulas are different there.
AJAY CHANDRA DORAGARI
2020년 8월 9일
got it change the formula of time response
it is h(t)=1+summation[((-1)^k)*2*Hk*cos(2*pi*kt/KT)
AJAY CHANDRA DORAGARI
2020년 8월 9일
there they missed the term (-1)^k ill update the code give me a min
AJAY CHANDRA DORAGARI
2020년 8월 9일
correct it the formula which they used in the first document which you sent
M = 256; %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
t=0:1000;
h=1+2*((-y(1)*cos((2*pi.*t)/l))+(y(2)*cos((4*pi.*t)/l))+(-y(3)*cos((6*pi.*t)/l)));
plot(h)
ylabel('h(t)')
xlabel('t')
grid on

AJAY CHANDRA DORAGARI
2020년 8월 9일
in this code i didnt use the for loop instead used element wise operation
use element wise operation wherever it is possible it is faster than the loop operations
AJAY CHANDRA DORAGARI
2020년 8월 9일
편집: AJAY CHANDRA DORAGARI
2020년 8월 9일
formula i have seen it first at the ieee paper but i dont know which paper it was then alternatingly added and substracted the terms Hk after trial and error i got it and then cross checked it with the graph and it made sense. Some terms must be substracted to get h(0) value to zero then i remembered generally the terms in fft analysis are alternating with positve and negative signs
Sara Nasir
2020년 8월 9일
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
t=0:1000;
h=1+2*((-y(1)*cos((2*pi.*t)/l))+(y(2)*cos((4*pi.*t)/l))+(-y(3)*cos((6*pi.*t)/l)));
plot(h)
ylabel('h(t)')
xlabel('t')
grid on
AJAY CHANDRA DORAGARI
2020년 8월 9일
편집: AJAY CHANDRA DORAGARI
2020년 8월 9일
no !
for 64 time period take upto t= 200
if you take more than 200 it will repeat again it will appear to be some sine wave where you cant make any distinction
AJAY CHANDRA DORAGARI
2020년 8월 9일
편집: AJAY CHANDRA DORAGARI
2020년 8월 9일
for 256
you take upto t= 1000 points
just play with it change the values and see the results check for different values of M
AJAY CHANDRA DORAGARI
2020년 8월 9일
im sorry my bad not time period in the previous post
take the value of t=200 for M=64
t=1000 for M=256 (it is small t not capital)
Sara Nasir
2020년 8월 9일
got it! Thankyou
And in the similar way i should calculate the freq response by the formula H(f). No need of for loop?
AJAY CHANDRA DORAGARI
2020년 8월 9일
yes it was the formula which was wrong and ofcourse the code which i used in the first post was wrong too which was a blunder i didnt cross check the formula which you had mentioned .i have taken the expression from your code which you have posted i made a mistake and realised it but in the end i could rectify it
AJAY CHANDRA DORAGARI
2020년 8월 9일
you could getaway maybe this time but even without for loop for frequency analysis the expression might be bit clumpsy because it contains six terms which can be simplified but im no expert i guess you could use it but sometimes you want have any other choice rather than using for loop
AJAY CHANDRA DORAGARI
2020년 8월 9일
i should thanq sara for keeping me busy during this pandemic time i could learn something about phydyas filter and rewind my coding even i started learning matlab just 2 months back for my masters project please do me a favour dont delete this question so i could revisit someday it might help for my own filter problem
Sara Nasir
2020년 8월 9일
I am trying to do with for loop because it is difficult to keep track of six values.
Well I am getting error this time during implementing it.
Sara Nasir
2020년 8월 9일
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
2020년 8월 10일
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)