sine wave max and min points normalization
Show older comments
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!!!
Answers (1)
Image Analyst
on 4 May 2014
Edited: Image Analyst
on 4 May 2014
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 Comments
Zacharias
on 5 May 2014
Image Analyst
on 7 May 2014
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
on 7 May 2014
You can do that if you want.
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!