How to input noise during the audio transmission process ?

1 vue (au cours des 30 derniers jours)
Sisi Misi
Sisi Misi le 21 Sep 2021
Commenté : Sisi Misi le 5 Oct 2021
Hello everyone
I do audio compression with bit per sample variations like this:
[y,Fs]=audioread('water.wav');
audiowrite('testing.flac',y,Fs,'BitsPerSample', 8);
Now I also want to input noise into the process
Does anyone know how the code should be used?
thank you

Réponse acceptée

Mathieu NOE
Mathieu NOE le 21 Sep 2021
hello
if you simply want to add some white noise you can do this
[y,Fs]=audioread('water.wav');
y = y + 0.1*randn(size(y)); % adjust amplitude to your needs
y = y./max(abs(y)); % normalize data to avoid saturation (may be depend on output format)
audiowrite('testing.flac',y,Fs,'BitsPerSample', 8);
you can also add a low or high or bandpass filter on the random noise if you want to have noise in a certain frequency range.
  19 commentaires
Mathieu NOE
Mathieu NOE le 1 Oct 2021
hello
so far the code will add the noise to the original audio , not the compressed audio
the compression is done after the noise is added (y = y + 0.01*randn(size(y));) , because as explained above , the compression is done inside audiowrtite when you select a certain type of format (wav and flac are both compressed audio formats)
Sisi Misi
Sisi Misi le 5 Oct 2021
Okay Mr, thank you so much

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by