Want binary output from given fsk demodulation

i am working with a calculation that is sent wirelessly by sound (fsk modulated) now i want to recover that first recording that signal and then demodulation ,demodulation into digital waveform (i have done all mentioned stuff now ...) i want to convert this digital waveforn into binarydata stored in an array.(audio siganl is attached)
clc;
clear all;
close all;
fc=500;
fs=8000;
fDev=50;
t=0.1;0.001;0.5;
% b=audiorecorder;
% recordblocking(b,3);
% a=getaudiodata(b);
% audiowrite('lala.wav',a,44100); %there is some issue in recording
y=audioread('lala.wav');
sound(y);% listen your audio input
z = fmdemod(y,fc,fs,fDev);
figure
plot(z);axis('tight');
wn=fc/fs;
s=fir1(50,wn,'low');
x=conv(s,z);
figure
plot(x);axis('tight');
%all starts here plz help!!
% mn=[];
% if(x>=20)
% j=1;
% else
% j=0;
% end
%
% mn=[mn j];
% disp(' Binary information at Reciver :'); %want this from all given data.
% disp(mn);
% %>>>>>>>>>>>>>>>>>>>>>>>>>> end of program >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>%

6 commentaires

I don't have the toolbox that contains fmdemod, so I can't run your code. It is also unclear to me what you are trying to do. Do you want to write something as a wav file?
It also looks like you're trying to treat x as a scalar in your commented code, instead of just doing this:
mn= double(x>=20);
osama saeed
osama saeed le 14 Déc 2019
no i just want to extract binary data from the wave like where it is having greater amplitude mark it as one and else as zero.
Rik
Rik le 14 Déc 2019
It looks like you have a lot of filtering to do. You data is a line plot that is oscilating very fast, so you will have to filter this (e.g. with movmax and movmin) to get an estimate of the enveloppe. When you have that data, you can use a line like I suggested to turn every element larger than 20 into a 1, and make the rest 0.
osama saeed
osama saeed le 14 Déc 2019
filter worked but still not able to extract data from it
Rik
Rik le 14 Déc 2019
If you put the data that you have plotted in a mat file I might be able to convert that to the binary signal you describe.
Star Strider
Star Strider le 14 Déc 2019
If you have the Signal Processing Toolbox, see if the demod function will work.

Connectez-vous pour commenter.

Réponses (0)

Produits

Version

R2018a

Commenté :

le 14 Déc 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by