How to convert an audio or mp3 signal to a binary signal?
39 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hussain Ahmad
le 14 Avr 2019
Commenté : Walter Roberson
le 2 Juin 2023
I have to read the audio signal
then covert the audio signal to the Binary SIgnal to be ready for the modulation.
How to perform the COnversion of the Audio SIgnal to Binary signal that could be domedulated in the end to give the original voice signal?
0 commentaires
Réponse acceptée
Walter Roberson
le 14 Avr 2019
filename = 'YourFileNameGoesHere.mp3';
fid = fopen(filename, 'r');
file_bits = fread(fid, [1 inf], 'bit1=>uint8');
fclose(fid);
file_bits is now a vector of binary values ready for modulation.
At the other end, demodulate into a vector of uint8, and do any appropriate error correction. Then
filename = 'YourOutputFileNameGoesHere.mp3';
outfid = fopen(filename, 'w');
fwrite(outfid, file_bits, 'bit1');
fclose(outfid);
The other end will now have a copy of the mp3 file, which can be played through whatever mp3 player the other end has.
Note: if there was uncorrected transmission noise, then the file that is written might be corrupted in a way that makes it impossible to play. So be sure to put in enough error detection and correction for the circumstances.
2 commentaires
sahil sharma
le 2 Juin 2023
As you have used modulation here can you explain what type of modulation is being used here?
Walter Roberson
le 2 Juin 2023
I did not use modulation here. It just reads the data as a bit stream.
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!