资源简介
详细的说明了用matlab进行能量检测的代码,很有用,绝对有参考价值。
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%设置参数%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all
close all
clc
pf=0.1; %虚警概率为0.1
fs=1000; %采样频率为1000
N=1024; %数据点数为1024
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%求信号的频谱%%%%%%%%%%%%%%%%%%%%%%%%%%
haoduan=zeros(110);
haoduan(2)=1; %原始信号的第2段有信号
haoduan(4)=1; %原始信号的第4段有信号
haoduan(7)=1; %原始信号的第7段有信号
haoduan(9)=1; %原始信号的第9段有信号
x=0;
m=0;
fc=180:180:500; %分配载频
for i=1:2
n=0:N-1;
t=n/fs; %时间序列
m=2*sin(2*pi*fc(i)*t);
x=x+m; %无噪声信号
end
y=x+2*randn(1length(t)); %含有噪声的信号
Y=fft(yN); %对含有噪声的信号进行快速Fourier变换
mag=abs(Y); %得到振幅值
f=n*fs/N; %频率序列
figure(1)
- 上一篇:三维光子晶体布拉格衍射峰寻峰软件
- 下一篇:contourlet、小波去噪
评论
共有 条评论