Borrar filtros
Borrar filtros

Construction of shifted matrix from known matrix

1 visualización (últimos 30 días)
Abdul Sajeed Mohammed
Abdul Sajeed Mohammed el 17 de Nov. de 2020
Comentada: Ameer Hamza el 17 de Nov. de 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

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 17 de Nov. de 2020
Editada: Ameer Hamza el 17 de Nov. de 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 comentarios
Abdul Sajeed Mohammed
Abdul Sajeed Mohammed el 17 de Nov. de 2020
Thank you very much worked for me.
Ameer Hamza
Ameer Hamza el 17 de Nov. de 2020
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by