clear;
clc;
symb = dec2bin(abs('i'))
bitstr = symb;
fs = 8000;
bdur = 0.05;
T = bdur;
F1 = 2000;
F0 = 1000;
t = [0:1/fs:bdur-1/fs]';
S1 = sin(2*pi*F1*t);
S0 = sin(2*pi*F0*t);
sig0 = []
for i=1:length(bitstr)
if bitstr(i)=='1'
sig0 = [sig0;S1];
elseif bitstr(i)=='0'
sig0 = [sig0;S0];
end
end
soundsc(sig0)
figure,plot(sig0)
%--------------------------------------------
%Adding 100Hz noise to sig.
x = [0:1/fs:0.35-1/fs]';
ns = 0.1*sin(2*pi*100*x);
figure,plot(x,ns)
soundsc(ns)
sig = sig0 + ns;
figure,plot(sig)
soundsc(sig)
%--------------------------------------------
%Fourier sa sig (figure contains both 1000 & 2000 frequencies)
Fs=8000;
freq = [0:1400]'/1400*(Fs/2);
SIG = fft(sig);
figure, plot(freq,abs(SIG(1:1401))), grid
%-------------------------------------------
%extracting first bit sa sig from 1-400
b1=sig(1:400);
figure,plot(b1)
freq1 = [0:200]'/200*(Fs/2);
B1 = fft(b1);
figure, plot(freq1,abs(B1(1:201))), grid
a1=[abs(B1)]';
%-------------------------------------------
%extracting second bit sa sig from 401-800
b2=sig(401:800);
figure,plot(b2)
freq2 = [0:200]'/200*(Fs/2);
B2 = fft(b2);
figure, plot(freq2,abs(B2(1:201))), grid
a2=[abs(B2)]';
%-------------------------------------------
%extracting 3rd bit sa sig from 801-1200
b3=sig(801:1200);
figure,plot(b3)
freq3 = [0:200]'/200*(Fs/2);
B3 = fft(b3);
figure, plot(freq3,abs(B3(1:201))), grid
a3=[abs(B3)]';
%-------------------------------------------
%extracting 4th bit sa sig from 1201-1600
b4=sig(1201:1600);
figure,plot(b4)
freq4 = [0:200]'/200*(Fs/2);
B4 = fft(b4);
figure, plot(freq4,abs(B4(1:201))), grid
a4=[abs(B4)]';
%-------------------------------------------
%extracting 5th bit sa sig from 1601-2000
b5=sig(1601:2000);
figure,plot(b5)
freq5 = [0:200]'/200*(Fs/2);
B5 = fft(b5);
figure, plot(freq5,abs(B5(1:201))), grid
a5=[abs(B5)]';
%-------------------------------------------
%extracting 6th bit sa sig from 2001-2400
b6=sig(2001:2400);
figure,plot(b6)
freq6 = [0:200]'/200*(Fs/2);
B6 = fft(b6);
figure, plot(freq6,abs(B6(1:201))), grid
a6=[abs(B6)]';
%-------------------------------------------
%extracting 7th bit sa sig from 2401-2800
b7=sig(2401:2800);
figure,plot(b7)
freq7 = [0:200]'/200*(Fs/2);
B7 = fft(b7);
figure, plot(freq7,abs(B7(1:201))), grid
a7=[abs(B7)]';
%-------------------------------------------
% demodulation
if a1(101)==200
A1=1;
else
A1=0;
end
if a2(101)==200
A2=1;
else
A2=0;
end
if a3(101)==200
A3=1;
else
A3=0;
end
if a4(101)==200
A4=1;
else
A4=0;
end
if a5(101)==200
A5=1;
else
A5=0;
end
if a6(101)==200
A6=1;
else
A6=0;
end
if a7(101)==200
A7=1;
else
A7=0;
end
binary = [A1 A2 A3 A4 A5 A6 A7]
demod.rar_fsk demod_matlab fsk demod
版权申诉
41 浏览量
2022-09-24
15:27:05
上传
评论
收藏 2KB RAR 举报
周楷雯
- 粉丝: 80
- 资源: 1万+
最新资源
- chromedriver-linux64.zip 是一个用于在 Linux 系统上运行 Chrome 浏览器的驱动程序
- 基于Python和PyTorch框架完成的一个手写数字识别实验源码(带MINIST手写数字数据集)+详细注释(高分项目)
- 基于Matlab在MNIST数据集上利用CNN完成手写体数字识别任务,并实现单层CNN反向传播算法+源代码+文档说明(高分项目)
- NVIDIA驱动、CUDA和Pytorch及其依赖
- html动态爱心代码一(附源码)
- c40539bc-071a-486c-9d52-9d0c18d62dac 4.html
- 基于物理的非视域成像(NLOS)算法,利用了nerf+python源码+文档说明
- yuluer知更鸟.7z(1).001
- python课程设计-基于tensorflow实现的图文生成程序,数据集flickr30k-images+源代码+文档说明+截图
- python作业-基于Flickr30k数据集实现图像文本跨模态搜索python源码+数据集+测试界面+项目说明(高分课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈