How do i normalize a signal so that it's maximum is 1?
30 ビュー (過去 30 日間)
古いコメントを表示
I know to do this all I would have to do is find the maximum value for the whole duration of the signal, and then divide the signal by this value. However, I'm having trouble capturing the maximum value signal as a constant value. When I tried using the running max block this didn't work correctly because the running max changes over time. Also, the normal max block simply outputs whatever signal is put into it, which isn't helpful.
Any help is appreciated.
3 件のコメント
Paul
2021 年 11 月 9 日
The problem statement is still unclear to me.
It sounds like you're running a model in Simulink. Is that correct?
If so, I don't understand what the goal is.
Do you want to wait until after the simulation completes and then normalize a signal that's been collected from the simulation, perhaps for plotting purposes? Of course, this won't change the actual results of the simulation.
Or, are you trying to manipulate a signal while the simulation is running? In which case much more clarity is needed on what you're trying to do, because at any instant in time the simulation can only modify the signal at that instant; it can't change anything that was computed in the past.
回答 (1 件)
Sulaymon Eshkabilov
2021 年 11 月 9 日
t=linspace(0, 2, 1e3);
f1 = 5;
f2 = 10;
S = cos(2*pi*f1*t)+sin(2*pi*f2*t)+rand(size(t))/5;
subplot(211)
plot(t,S), title('Original Signal'), grid on
SM = max(S);
SN = S/SM(1);
subplot(212)
plot(t, SN), grid on; title 'Normalized Signal';
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spectral Analysis についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!