# How do I calculate the impulse response?

2 views (last 30 days)
Niamh Mc Devitt on 22 Oct 2013
Commented: Image Analyst on 23 Oct 2013
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, h = 3, h = -2, h = NUM(1), h = NUM(2)
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?
Image Analyst on 23 Oct 2013
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.

Image Analyst on 22 Oct 2013
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 CommentsShowHide 1 older comment
Image Analyst on 23 Oct 2013
To recap, use parentheses instead of bracket:
h(1) = 1; % NOT h = 1, which will cause a syntax error.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9144383,"math_prob":0.48890138,"size":1669,"snap":"2022-27-2022-33","text_gpt3_token_len":442,"char_repetition_ratio":0.07627628,"word_repetition_ratio":0.0,"special_character_ratio":0.2792091,"punctuation_ratio":0.11570248,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97948366,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-14T02:39:55Z\",\"WARC-Record-ID\":\"<urn:uuid:bbe38a60-5fd4-4817-8408-090a695263ce>\",\"Content-Length\":\"138692\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5c704402-5a6b-4abe-97b7-82a931d9f18e>\",\"WARC-Concurrent-To\":\"<urn:uuid:34a55133-b5bb-4e6d-a396-457338fa7801>\",\"WARC-IP-Address\":\"104.68.243.15\",\"WARC-Target-URI\":\"https://nl.mathworks.com/matlabcentral/answers/91078-how-do-i-calculate-the-impulse-response\",\"WARC-Payload-Digest\":\"sha1:XAP5HFLWT5Y2SAC3PINCQ3DREN5MZ4OZ\",\"WARC-Block-Digest\":\"sha1:YJ45YUACCI5QMOXBAGQ32TX3WCPWAJ7A\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882571993.68_warc_CC-MAIN-20220814022847-20220814052847-00270.warc.gz\"}"}