필터 지우기
필터 지우기

How do I calculate the impulse response?

조회 수: 2 (최근 30일)
Niamh Mc Devitt
Niamh Mc Devitt 2013년 10월 22일
댓글: Image Analyst 2013년 10월 23일
I am having trouble working out how to do this question given to me in an assignment.
Question
Given the following impulse response:
h[1] = 1, h[2] = 3, h[3] = -2, h[4] = NUM(1), h[5] = NUM(2)
load data_for_conv.mat
This is fake data consisting of 100 channels of 200 samples (100 rows x 200 columns).
Plot the data contained in channel NUM in a subplot (Note: how to do this is given in assignment_1_question_5.m) On the next subplot, plot h On the final subplot, plot h*data(NUM,:) (i.e., the convolution of h with data(NUM,:) ).
I can plot the data, but once I sub my channel number in to the equation above for h it doesn't seem to work. Is there something i'm missing?
  댓글 수: 3
Niamh Mc Devitt
Niamh Mc Devitt 2013년 10월 23일
data = randn(100,300); >> channel = 97; >> figure, plot( data(channel,:) ); >> h[1] = 1, h[2] = 3, h[3] = -2, h[4] = 97(1), h[5] = 97(2); h[1] = 1, h[2] = 3, h[3] = -2, h[4] = 97(1), h[5] = 97(2); | Error: Unbalanced or unexpected parenthesis or bracket.
Hi so this is what I put in, I plotted my channel first and then I added it in to the formula. Thanks
Image Analyst
Image Analyst 2013년 10월 23일
Why did you not heed my answer where 17 hours ago I told you the reason? You didn't read my answer in your prior post either. You couldn't have not seen them. I can just ignore your posts if you don't want to read my answers. Let me know.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2013년 10월 22일
So what didn't work when you tried it? "Doesn't seem to work" is not enough explanation for us to guess what went wrong. Was it that you used brackets in setting up h instead of parentheses? Was it that NUM is a 2 element array sometimes but expected to be a single scalar number at other times? Or both?
  댓글 수: 2
Niamh Mc Devitt
Niamh Mc Devitt 2013년 10월 23일
Hi the reason I did this is because I didn't quite understand your answer and someone else had told me to paste the code. I am a completely new user to Matlab so my knowledge even of the terminology is quite low. Sorry if this annoyed you I was just trying to provide as much information as possible by putting in what I already wrote in matlab.
Image Analyst
Image Analyst 2013년 10월 23일
To recap, use parentheses instead of bracket:
h(1) = 1; % NOT h[1] = 1, which will cause a syntax error.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Pulsed Waveforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by