sine wave max and min points normalization

i have a table (960x15) where each column refers to a sine wave.how can i find from the table the max and min points of each sine wave, normalize them by making them equal to their next point, find the peak to peak array before and after the normalization,find the peak to peak difference and show the results in additional arrays.
after all the above i need to find the average in each sine wave, delete it from the sine wave so that the sine wave moves closer to 0,then find the 5 sine waves that have the maximum peak to peak difference after their normalization,and show 5 figures with 2 waves each one.the first will be the sine wave without normalization and the second after the normalization.
thanks in advance
thanks again!!!

답변 (1개)

Image Analyst
Image Analyst 2014년 5월 4일
편집: Image Analyst 2014년 5월 4일

0 개 추천

Try this:
[rows, columns] = size(sineWaveArray2D)
maxValues = max(sineWaveArray2D)
minValues = min(sineWaveArray2D)
% Normalize each column in range 0 to 1.
normalizedSineWaveArray2D = zeros(rows, columns); % Initialize
for col = 1 : columns
normalizedSineWaveArray2D(:,col) = ...
(normalizedSineWaveArray2D(:, col) - minValues(col)) ./ ...
(maxValues(col) - minValues(col));
subplot(2,5,col);
plot(normalizedSineWaveArray2D(:,col), 'r-');
title('Original', 'FontSize', 14);
grid on;
subplot(2,5,col+5);
plot(sineWaveArray2D(:,col), 'b-');
title('Normalized', 'FontSize', 14
grid on;
end
normalizedSineWaveArray2D
After normalization the "peak to peak difference" will obviously be 1 since the array is now normalized, so I don't know why you're asking for that. You could scale to -1 to +1 instead of 0 to 1 with trivial changes of course. Feel free to adapt it.

댓글 수: 3

Zacharias
Zacharias 2014년 5월 5일
thanks my friend.i'll try your answer and see how it works!!!
Zacharias's "Answer" moved here to be a comment.
what if i do not want to normalize the sine wave and just replace the max and min points with their next one?
You can do that if you want.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2014년 5월 4일

댓글:

2014년 5월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by