How to get the central data of a matrix?

2 visualizaciones (últimos 30 días)
Jason Jeong
Jason Jeong el 25 de Abr. de 2017
Comentada: Jason Jeong el 25 de Abr. de 2017
The short of it is that I need the middle 1024x1 data points in a 1075x1 set.
Long story, I have a signal (1024x1) that is filtered/convoluted with a lowpass filter that gives me a 1024x1/1075x1 filtered signal. From graphing all three (black-original, blue-convolution, red-filter) it looks like the convolution gives me a 1075x1 signal that is shifted from the original signal by the extra data points from the filtering. The filter function is supposed to give me the same size output as the input but it looks like it's just cutting off the last 51 data points and not really centering it.
My question is how do I cut the first and last 25 data points from the 1075x1 matrix so that when I graph the original signal with the filtered signal, it is centered correctly.

Respuesta aceptada

Joseph Cheng
Joseph Cheng el 25 de Abr. de 2017
Editada: Joseph Cheng el 25 de Abr. de 2017
you'd use the parameter 'same' in the convolution function
x = [0 1 2 3 4 5 4 3 2 1 0]
conv(x,[0 1 0],'same')
otherwise if you know the length of the convoluted signal giving 25 extra points you can just delete them by
outputans([1:25 end-24:end])=[];

Más respuestas (0)

Categorías

Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by