How to convert an audio or mp3 signal to a binary signal?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hussain Ahmad
am 14 Apr. 2019
Kommentiert: Walter Roberson
am 2 Jun. 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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 14 Apr. 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 Kommentare
sahil sharma
am 2 Jun. 2023
As you have used modulation here can you explain what type of modulation is being used here?
Walter Roberson
am 2 Jun. 2023
I did not use modulation here. It just reads the data as a bit stream.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Modulation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!