# How do I calculate the impulse response?

2 views (last 30 days)

Show older comments

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 Comments

Image Analyst
on 23 Oct 2013

### Answers (1)

Image Analyst
on 22 Oct 2013

##### 2 Comments

Image Analyst
on 23 Oct 2013

To recap, use parentheses instead of bracket:

h(1) = 1; % NOT h[1] = 1, which will cause a syntax error.

### See Also

### Community Treasure Hunt

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

Start Hunting!