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

📄 generator_color_noise.m

📁 This program generates a color signal as the input signal and a desired signal of the idetification
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                                                             %
%  This program generates a color signal as the input signal and a desired signal of the idetification plant  %
% on Nov 11,2007                                      %
%                                                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [x,d,num]=generator_color_noise(K,snr,N,Fa,Fb);
%[x,d,num]=generator_color_noise(10000,25,512,0.35,0.65);

%----------------------------------------------------%
% Input parameters:
%            K    :   the length of the signal
%            N    :   the order plus 1
%            snr  :   ratio of the input signal to noise signal
%            Fa   :   the low cut-off frequency of the plant
%            Fb   :   the up cut-off frequency of the plant
%----------------------------------------------------%

%---------------initialization-----------------------%
x=randn(1,K);                                               %  generate a random signal as input signal
d=zeros(1,K);                                               %  define the desired signal

%-----------signal generation------------------------%
num=fir1(N-1,[Fa Fb]);                                      %  generate the numerator of the transforing function
den=[1];                                                    %  generate the denominator of the transforing function
d=filter(num,den,x);                                        %  get the desired signal by filtering the input signal
d=awgn(d,snr);                                              %  add the noise signal to the desired ignal



⌨️ 快捷键说明

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