Manually adjusting amplitude of audio
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alex
le 1 Déc 2014
Réponse apportée : Anathea Pepperl
le 10 Déc 2014
I am trying to distort an audio file. How can I adjust the amplitude of the waveform so that the peaks are all maximized to a predetermined value? The idea is to be able to manipulate the amplitude level and thus manipulate the level of distortion. I am using a .wav file.
This is the effect I am looking for: http://en.wikipedia.org/wiki/Distortion#mediaviewer/File:Distortion_waveform.svg
0 commentaires
Réponse acceptée
Anathea Pepperl
le 10 Déc 2014
I'm assuming that you are using a .wav file. First you will want to use wavread to read the audio data into Matlab. Then you could use logical indexing, like audio_data(audio_data > thresh) = max_value; in order to force values above a certain value.
You could also find peaks by finding where the derivative is 0 (use the second derivative to find if that value is a min or a max), and set the local maxima to your predetermined value.
Hope this helps!
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Audio I/O and Waveform Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!