⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fmnoise.m

📁 % This program calculates radar ranges in a jamming environment. It works % with both Stand-off jam
💻 M
字号:
% FM Noise Spectrum
%----------------------

clf;clc;clear;

% Define Time Vector -tmax to tmax

N=4096;tmax=1/2;
t=2*tmax*(-N/2:N/2-1)/N;

% Sample Frequency fs

fs=N/(2*tmax);

% Generate Gaussian Noise Vector - N(0,1)

n=randn(1,N);
subplot(2,2,1);plot(t,n);grid;
xlabel('Time'):ylabel('Noise Voltage');
title(['Gaussian Noise Voltage']);

% Generate 'Erfed' Noise

y=erf(n);

% Shape Noise With Elliptical Filter

 [b,a]=ellip(6,.5,.5,.005);
% [b,a]=butter(6,.005);
% [b,a]=cheby1(6,.5,.005);
v=filter(b,a,n);
verf=filter(b,a,y);

% Define VCO with k=50 Hz/v

f0=0;k=50;j=sqrt(-1);
f=f0+k*v;
f1=f0+k*verf;
x=cos(2*pi*f.*t)+j*sin(2*pi*f.*t);
xerf=cos(2*pi*f1.*t)+sin(2*pi*f1.*t);

% Find Power Spectrum for v(t)

V=fft(v);
Pv=V.*conj(V);
Pv=fftshift(Pv);

% Find Power Spectum for x(t) and xerf(t)

X=fft(x);XE=fft(xerf);
Px=X.*conj(X);Pxe=XE.*conj(XE);
Px=fftshift(Px);Pxe=fftshift(Pxe);

% Normalize Amplitude

Px=Px/max(Px);Pv=Pv/max(Pv);Pxe=Pxe/max(Pxe);
Pxdbm=30+10*log10(Px+1e-6);
Pvdbm=30+10*log10(Pv+1e-6);
Pxedbm=30+10*log10(Pxe+1e-6);

% Select Frequency Axis

fsam=fs*(-N/2:N/2-1)/N;

% Plot Noise Spectrum

subplot(2,2,2);
plot(fsam,Pvdbm);grid;
axis([-300,300,-30,30]);
xlabel('Hz');ylabel('DBM');
title(['Noise Spectrum']);

% Plot FM Noise Spectrum

subplot(2,2,3);
plot(fsam,Pxdbm);grid;
axis([-1000,1000,-30,30]);
xlabel('Hz');ylabel('DBM');
title(['FM Noise Spectrum']);

% Plot Erfed FM Noise Spectrum

subplot(2,2,4);
plot(fsam,Pxedbm);grid;
xlabel('Hz');ylabel('DBM');
axis([-1000,1000,-30,30]);
title(['Erfed FM Noise Spectrum']);
end 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -