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

📄 ncofsymbol_tb.m

📁 quartus2环境中设计的高速任意波形发生器
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Altera NCO version 7.2% file : ncofsymbol_tb.m%% Description : The following Matlab testbench excercises the NCO model ncofsymbol_model.m% generated by Altera's NCO Megacore and outputs the sine and cosine waveforms% to the variables sin_out and cos_out respectively%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Parameter description% N : the length of input and output arrays% fs : the desired sampling rate. For Multi-channel NCO's the channelized sample rate is fs/M %      ehre M is the number of channels%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%N=2048*1;fs = 2.5E8;% Input arrays% phi_inc_i : input phase increment : Length N (required)phi_inc_i = 171798692.*ones(1,N);% freq_mod_i : frequency modulation input : Length N (optional)freq_mod_i = zeros(1,N);% phase_mod_i : phase modulation input : Length N (optional)phase_mod_i = 4096.*ones(1,N);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function call to generated nco function[sin_out,cos_out] = ncofsymbol_model(phi_inc_i,phase_mod_i,freq_mod_i);fid_s = fopen('fsin_o_ncofsymbol_matlab.txt','w');for i=1:N  fprintf(fid_s,'%f\n',sin_out(i));end% Plot Channel 0 Time-Domain Outputxvalst = (0:1/fs:((N/1)-1)/fs);figure,stairs(xvalst,sin_out(1:1:N),'r');title ('Time-Domain Plot of NCO Channel 0 Output');grid on;zoom on;xlabel ('Time');ylabel ('Amplitude');ncofftwinplot(sin_out(1:1:N),fs,0,'r');

⌨️ 快捷键说明

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