How to get the central data of a matrix?

2 次查看(过去 30 天)
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.

采纳的回答

Joseph Cheng
Joseph Cheng 2017-4-25
编辑:Joseph Cheng 2017-4-25
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])=[];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matched Filter and Ambiguity Function 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by