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
2014년 5월 4일
편집: Image Analyst
2014년 5월 4일
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
2014년 5월 5일
Image Analyst
2014년 5월 7일
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?
Image Analyst
2014년 5월 7일
You can do that if you want.
카테고리
도움말 센터 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!