am相干解调matlab文档,基于MATLAB的AM调制与相干解调.docx

AM的调制与相干解调

%四个函数放在同一路径下即可

function am_xianggan()

close all;

clear all;

dt=0.001;

fm=1;

fc=10;

T=5;

t=0:dt:T;

mt=sqrt(2)*cos(2*pi*fm*t);

A=2;

s_am=(A+mt).*cos(2*pi*fc*t);

figure(1);

subplot(311);

plot(t,s_am);hold on;

plot(t,A+mt,'r--');

title('AMμ÷??D?o??°??°ü??');

xlabel('t');

rt=s_am.*cos(2*pi*fc*t);

rt=rt-mean(rt);

[f,rf]=T2F(t,rt);

[t,rt]=lpf(f,rf,2*fm);

subplot(312);

plot(t,rt);hold on;

plot(t,mt/2,'r--');

title('?à?é?aμ÷oóD?o?2¨D?ó?ê?è?D?o?μ?±è??');

xlabel('t');

subplot(313);

[f,sf]=T2F(t,s_am);

psf=(abs(sf).^2)/T;

plot(f,psf);

axis([-2*fc 2*fc 0 max(psf)]);

title('AMD?o?1|?ê?×');

xlabel('f');

function [t st]=F2T(f,sf)

%This function calculate the time signal using ifft function for the input

%signal's spectrum

df = f(2)-f(1);

Fmx = ( f(end)-f(1) +df);

dt = 1/Fmx;

N = length(sf);

T = dt*N;

%t=-T/2:dt:T/2-dt;

t = 0:dt:T-dt;

sff = fftshift(sf);

st = Fmx*ifft(sff);

function [f,sf]= T2F(t,st)

%This is a function using the FFT function to calculate a signal's Fourier

%Translation

%Input is the time and the signal vectors,the length of time must greater

%than 2

%Output is the frequency and the signal spectrum

dt = t(2)-t(1);

T=t(end);

df = 1/T;

N = length(st);

f=-N/2*df:df:N/2*df-df;

sf = fft(st);

sf = T/N*fftshift(sf);

function [ t,st] = lpf( f,sf,B)

df=f(2)-f(1);

T=1/df;

hf=zeros(1,length(f));

bf=[-floor(B/df):floor(B/df)]+floor(length(f)/2);

hf(bf)=1;

yf=hf.*sf;

[t,st]=F2T(f,yf);

st=real(st);

end

运行>> am_xianggan()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值