how can i add noise to a voice signal?

i have tried to use agwn and randn functions but it gives me error saying Integers can only be combined with integers of the same class, or scalar doubles.please help

Réponses (1)

Wayne King
Wayne King le 6 Déc 2012
Modifié(e) : Wayne King le 6 Déc 2012
Your speech waveform is probably class int16 (I'm guessing), you can check by entering
class(waveform)
where waveform is the variable name for your speech signal.
To add noise, cast it to double (one option)
waveform = double(waveform);
Then you can add noise using randn() or agwn()
Another option is to cast the noise to int16 (or whatever class your waveform is) if you want the final signal to be integers. For example:
x = ones(100,1,'int16');
x = x+int16(randn(size(x)));
You just have to be careful to realize that the latter won't be strictly Gaussian (they're integers).

Catégories

En savoir plus sur Signal Processing Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by