%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Altera NCO Compiler version 2.2.0
% file : nco_Fc_tb.m
%
% Description : The following Matlab testbench excercises the NCO model nco_Fc_model.m
% generated by Altera's NCO Compiler 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.5E7;
% 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 = zeros(1,N);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function call to generated nco function
[sin_out,cos_out] = nco_Fc_model(phi_inc_i,phase_mod_i,freq_mod_i);
fid_s = fopen('fsin_o_nco_Fc_matlab.txt','w');
for i=1:N
fprintf(fid_s,'%f\n',sin_out(i));
end
% Plot Channel 0 Time-Domain Output
xvalst = (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');
fcc2008
- 粉丝: 55
- 资源: 242
最新资源
- 毕设和企业适用springboot智慧城市类及旅游资源管理平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及企业风险监控平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及客户管理系统源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及全生命周期管理平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及生活服务平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及食品配送平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及视频内容分发平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及无人机管理平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及无人驾驶系统源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市类及疫情追踪系统源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市数据分析平台类及3D建模平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市数据分析平台类及AI数据标注平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市数据分析平台类及车载智能管理平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市数据分析平台类及产品体验管理系统源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市数据分析平台类及个性化推荐平台源码+论文+视频.zip
- 毕设和企业适用springboot智慧城市数据分析平台类及健康风险评估平台源码+论文+视频.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈