Construction of shifted matrix from known matrix
1 view (last 30 days)
Show older comments
Abdul Sajeed Mohammed
on 17 Nov 2020
Commented: Ameer Hamza
on 17 Nov 2020
I have matrix 'h' which is of matrix 2056. I need to build matrix 'H' using shifted version of 'h'.
Construction example : Suppose an impulse responce has length of 6 :
h = [h0 h1 h2 h3 h4 h5 h6] '
I need to change length to FIR filter length of 4 such as :
H = [ h0 0 0 0 ]
[ h1 h0 0 0 ]
[ h2 h1 h0 0 ]
[ h3 h2 h1 h0 ]
[ h4 h3 h2 h1 ]
[ h5 h4 h3 h2 ]
[ 0 h5 h4 h3 ]
[ 0 0 h5 h4 ]
[ 0 0 0 h5 ]
I need to produce this kind of matrix. Any help will be very useful. Thank you
0 Comments
Accepted Answer
Ameer Hamza
on 17 Nov 2020
Edited: Ameer Hamza
on 17 Nov 2020
Try toeplitz()
h = 1:6;
m = 4;
n = numel(h)+m-1;
M = toeplitz([h zeros(1,m-1)], [h(1) zeros(1,m-1)])
Result
>> M
M =
1 0 0 0
2 1 0 0
3 2 1 0
4 3 2 1
5 4 3 2
6 5 4 3
0 6 5 4
0 0 6 5
0 0 0 6
2 Comments
More Answers (0)
See Also
Categories
Find more on Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!