How to convert an audio or mp3 signal to a binary signal?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hussain Ahmad
el 14 de Abr. de 2019
Comentada: Walter Roberson
el 2 de Jun. de 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 comentarios
Respuesta aceptada
Walter Roberson
el 14 de Abr. de 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 comentarios
sahil sharma
el 2 de Jun. de 2023
As you have used modulation here can you explain what type of modulation is being used here?
Walter Roberson
el 2 de Jun. de 2023
I did not use modulation here. It just reads the data as a bit stream.
Más respuestas (0)
Ver también
Categorías
Más información sobre Modulation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!