How to normalize a discrete signal?

10 visualizzazioni (ultimi 30 giorni)
RoBoTBoY
RoBoTBoY il 23 Gen 2021
Commentato: Adam Danz il 24 Gen 2021
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

Risposta accettata

Adam Danz
Adam Danz il 23 Gen 2021
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 Commenti
Adam Danz
Adam Danz il 24 Gen 2021
The normalization to [0,10] would have been
n = (x-min(x))/range(x)*10;
Adam Danz
Adam Danz il 24 Gen 2021
Since you're new question differs greatly from the original one, it would be better to post it as a new question.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Time-Frequency Analysis in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by