How to test if two signals are equal
Mostrar comentarios más antiguos
Hello, I have computed by hand the frequency domain transfer function from a difference equation of a digital filter. I wanted to test if my computation is right, so I implemented both the difference equation and the frequency domain transfer function in Matlab. I chose a signal and I sent it through both of them separately. Now, how do I test if the two filtered signals are equal?
Thanks.
Respuesta aceptada
Más respuestas (2)
Image Analyst
el 25 de Nov. de 2011
0 votos
Did you try subtracting them and seeing if all the elements are zero (or really close to zero)?
2 comentarios
Italo
el 25 de Nov. de 2011
Image Analyst
el 25 de Nov. de 2011
Maybe try normalized cross correlation using normxcorr2() in the Image Processing Toolbox. Look for high values indicating it is well aligned for some shift.
Wayne King
el 25 de Nov. de 2011
0 votos
Why do you need to input a signal? If you have the Fourier transform of your filter and the coefficients that give the difference equation, then just use freqz() with the coefficients to see if you have the correct Fourier transform.
Categorías
Más información sobre Signal Processing Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!