could you please make a complete code about the following question???

this question is related to Convoution in Signal...
X[n]*h[n] = [20cos(5πn+ π/3)+cos(200πn)] * 1/3 ( delta [n-2]+ delta [n-1]+ delta [n] )
= 20/3cos[5π(n-2)+ π/3]+ 20/3cos[5π(n-1)+ π/3]+ 20/3cos[5π(n)+ π/3]+
1/3cos[200π(n-2)]+ 1/3cos[200π(n-1)]+ 1/3cos[200π(n)]
////////////// But, n should be from 0 to 299
Unfortunately, I cannot do creat matlab code about this question...
Please solve this problem, matlab EXPERT!!!

3 件のコメント

Jan
Jan 2011 年 11 月 30 日
We cannot know what "delta[n]" and "5π(n-2)" means.
I suggest to read the Getting Started chapters of the documentation and learn how to use Matlab syntax. Otherwise even the smallest modifications of the posted source code would be an impossible task for you.
Hint: for n=0:299, ... end
Hin Kwan Wong
Hin Kwan Wong 2011 年 11 月 30 日
most probably, delta[n] is the backward shift operator
5π(n-2) is 5*pi*(n-2) I suppose
Jan
Jan 2011 年 12 月 1 日
@Hin Kwan Wong: The backward shift operator - good guess!

サインインしてコメントする。

 採用された回答

Hin Kwan Wong
Hin Kwan Wong 2011 年 11 月 30 日

0 投票

It's not hard of a question if I understand what Lee means as it stands From the first part: X[n]*h[n]=[20cos(5πn+ π/3)+cos(200πn)] * 1/3 ( delta [n-2]+ delta [n-1]+ delta [n] )
Clearly implies h the impulse response is 1/3(z^-2 + z^-1+1) , which is just a moving average filter.
X is a signal 20cos(5πn+ π/3)+cos(200πn)]
you can find the result by
N=2,step=0.01
h = [1/3 1/3 1/3];
t=0:step:N;
X=20*cos(5*pi*t+pi/3)+cos(200*pi*t)
Y=filter([1/3 1/3 1/3],1,X)

6 件のコメント

Lee Jae-yeon
Lee Jae-yeon 2011 年 12 月 1 日
in fact,I haven't learnt 'filter'.... so is there another way to solve this problem???
Jan
Jan 2011 年 12 月 1 日
@Lee Jae-yeon: If you haven't learnt it, learn it now: "help filter" and "doc filter" contain a sufficient number of information.
Hin Kwan Wong
Hin Kwan Wong 2011 年 12 月 1 日
You can also use the convolution command to do the same thing
conv(h,X)
But it will give you 2 more values at the end due to transient.
Also, for both methods there will be a starting transient because it is not a steady state solution.
Since X is periordic, it may be beneficial to use
Y=filter([1/3 1/3 1/3],1,repmat(X(:),2,1));
X=(length(X)/2+1:end);
Which takes the 2nd period of the result to eliminate the transient.
Lee Jae-yeon
Lee Jae-yeon 2011 年 12 月 1 日
But the condition is that the problem cannnot be used filter utility... Then there are other ways??
Hin Kwan Wong
Hin Kwan Wong 2011 年 12 月 1 日
I have already posted other ways, including the use of the convolution function conv.
Hin Kwan Wong
Hin Kwan Wong 2011 年 12 月 1 日
you can even use fast fourier transform
ifft(fft([1/3;1/3;1/3;zeros(length(X)-3,1)]).*fft(X))

サインインしてコメントする。

その他の回答 (1 件)

insat code
insat code 2018 年 10 月 30 日

0 投票

Many source code providers available in market place, but meter is how many providers provide licence version code, tested codes, no-bugs, error, updated codes, support latest version of play store. So i think instacode.in is best for buy and sell source code. i’m not promoting this site, i am saying truth. because this website provide fully secured codes with licences and updated version code. also provide 75% cost to developers or vendors. so this is better than other market place.

タグ

質問済み:

2011 年 11 月 30 日

回答済み:

2018 年 10 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by