I want to convert a .wav file to binary,modulate it,transmit,demodulate and convert the binary back to .wav file.But I am not able to write binary data back to wav file.
Afficher commentaires plus anciens
wavdata = audioread('roja.wav');
wavbinary = dec2bin( typecast( single(wavdata(:)), 'uint8'), 8 ) - '0';
orig_size = size(wavdata);
wavb1=uint8(wavbinary);
w1=reshape(wavb1,15486976,1);
xmod=qammod(w1,16,0,'gray');
y1=awgn(xmod,10);
rdmod=qamdemod(y1,16,0,'gray');
% rdmod1=reshape(rdmod,1935872,8);
rdmod2=uint8(rdmod);
data = uint8(bin2dec( char( reshape( rdmod2, 8,[]).'+'0')));
audiowrite(data, 'rec_roja.wav',8000)
Error using bin2dec (line 55)
Binary string may consist only of characters 0 and 1
Error in wavb (line 14)
data = uint8(bin2dec( char( reshape( rdmod2, 8,[]).'+'0')));
also waveread is not working in r2016
6 commentaires
KALYAN ACHARJYA
le 25 Sep 2018
Can you share roja.wav this file, so that we can try on your code?
KALYAN ACHARJYA
le 25 Sep 2018
Modifié(e) : KALYAN ACHARJYA
le 25 Sep 2018
Delete your comment from answer section, please note this is comment section, you can use google drive and share
NEEMA RAJ
le 25 Sep 2018
NEEMA RAJ
le 25 Sep 2018
Modifié(e) : Walter Roberson
le 26 Sep 2018
KALYAN ACHARJYA
le 25 Sep 2018
OK
NEEMA RAJ
le 26 Sep 2018
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!