您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 基于MATLAB的VSB实验及其波形图
六号跑道提供基于MATLAB的VSB程序及其波形图一.运行程序%---------------------------------------%显示模拟调制的波形及其解调方法VSB,文件名:VSB.m%Signaldt=0.001;fmax=6;fc=45;T=5;N=T/dt;t=[0:N-1]*dt;mt=sqrt(2)*(cos(2*pi*fmax*t)+sin(2*pi*0.5*fmax*t));%VSBmodulations_vsb=mt.*cos(2*pi*fc*t);B1=0.2*fmax;B2=1.2*fmax;[f,sf]=FFT_SHIFT(t,s_vsb);[t,s_vsb]=vsbmd(f,sf,B1,B2,fc);%PowerSpectrumDensity[f,sf]=FFT_SHIFT(t,s_vsb);PSD=(abs(sf).^2)/T;%PlotVSBandPSDfigure(1)subplot(211)plot(t,s_vsb);holdon;plot(t,mt,'r--');title('VSB调制信号');xlabel('t');subplot(212)plot(f,PSD);axis([-2*fc2*fc0max(PSD)]);title('VSB信号功率谱');xlabel('f');二.调用程序1%调用函数function[f,sf]=FFT_SHIFT(t,st)%ThisfunctionisFFTtocalculateasignal’sFouriertransform%Input:t:samplingtime,st:signaldata.Timelengthmustgreaterthean2%output:f:samplingfrequency,sf:frequen%outputisthefrequencyandthesignalspectrum六号跑道提供dt=t(2)-t(1);T=t(end);df=1/T;N=length(t);f=[-N/2:N/2-1]*df;sf=fft(st);sf=T/N*fftshift(sf);三.调用程序2function[t,st]=IFFT_SHIFT(f,Sf)df=f(2)-f(1);fmax=(f(end)-f(1)+df);dt=1/fmax;N=length(f);t=[0:N-1]*dt;Sf=fftshift(Sf);st=fmax*ifft(Sf);st=real(st)四.调用程序3function[t,st]=vsbmd(f,sf,B1,B2,fc)%Thisfunctionisaresidualbandpassfilter%Inputsf:samplefrequency,sf:frequencyspectrumdata%B1:residualbandwidth,B2:highestfreqofthebasebandsignal%Outputst:sampletime,st:signaldatadf=f(2)-f(1);T=1/df;hf=zeros(1,length(f));bf1=[floor((fc-B1)/df):floor((fc+B1)/df)];bf2=[floor((fc-B1)/df)+1:floor((fc+B2)/df)];f1=bf1+floor(length(f)/2);f2=bf2+floor(length(f)/2);stepf=1/length(f1);hf(f1)=0:stepf:1-stepf;hf(f2)=1;f3=-bf1+floor(length(f)/2);f4=-bf2+floor(length(f)/2);hf(f3)=0:stepf:(1-stepf);hf(f4)=1;yf=hf.*sf;[t,st]=IFFT_SHIFT(f,yf);st=real(st);六号跑道提供五.波形图
本文标题:基于MATLAB的VSB实验及其波形图
链接地址:https://www.777doc.com/doc-4016960 .html