How to normalize a discrete signal?

조회 수: 11 (최근 30일)
RoBoTBoY
RoBoTBoY 2021년 1월 23일
댓글: Adam Danz 2021년 1월 24일
Hello!!
I want to calculate the signal energy in rolling windows, after first normalizing to interval [-1,1].
Firstly, I wrote the below code to read and sound the signal.
[y,Fs] = audioread('viola_series.wav');
plot(y);
title('Audio viola series.wav');
sound(y,Fs);
How to do the normalization?
Thanks in advance

채택된 답변

Adam Danz
Adam Danz 2021년 1월 23일
Audio data are typically already normalized between [-1,1]. Are you getting values outside of that range?
min(y)
max(y)
Anyway, this is how to normalize any vector to [-1,1];
ynorm = (y-min(y))/range(y)*2-1;
  댓글 수: 5
Adam Danz
Adam Danz 2021년 1월 24일
The normalization to [0,10] would have been
n = (x-min(x))/range(x)*10;
Adam Danz
Adam Danz 2021년 1월 24일
Since you're new question differs greatly from the original one, it would be better to post it as a new question.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by