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

📄 wbsignal.m

📁 本文件囊括了数字信号处理常用滤波器的C语言程序。For each project example, a folder is available that contains appropriate fi
💻 M
字号:
%wbsignal.m Generates wide band random sequence.Represents one info bit

len_code = 128;  				 %length of random sequence 
code = 2*round(rand(1,len_code))-1;  %generates random sequence {1,-1}
sample_rate = 2;          		 %up-sampling from 4 to 8 kHz
NS = len_code * sample_rate;         %length of up-sampled sequence
sig = zeros(1,NS);                   %initialize random sequence
for i = 1:len_code                   %obtain up-sampled random sequence
   sig((i-1)*sample_rate + 1:i*sample_rate) = code(i);
end;
wbsignal = sig*5000;             	 %scale for p-p amplitude of 500 mV

fid=fopen('wbsignal.h','w');         %open file for wideband signal
fprintf(fid,'#define NS 256 //number of output sample points\n\n');
fprintf(fid,'short wbsignal[256]={');
fprintf(fid,'%d, ' ,wbsignal(1:NS-1));
fprintf(fid,'%d' ,wbsignal(NS));
fprintf(fid,'};\n\n'); 
fclose(fid);
return;

⌨️ 快捷键说明

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