【FPGA作业】第五章 单音信号对载波信号进行双边带幅度调制

五 单音信号对载波信号进行双边带幅度调制

5.1 实验内容

  • 合成一个双边带AM调制信号,载波频率1MHz,调制信号1KHz,采样率50MHz
  • 使用Modelsim仿真,观察波形,使用Matlab观察频谱
  • 使用Signaltap抓取电路输出波形,使用Matlab观察频谱
    方案描述
  • 使用两个DDS,一个DDS为1MHz,另一个为1KHz,直接相乘
  • ROM表由Matlab生成,10bit地址,10bit量化
  • 相位累加器32bit

5.2 原理

(1)DDS原理

这里写图片描述

(2)双边带调幅原理

时域表达式
这里写图片描述
这里写图片描述
图5. 1 DSB时域图像
频域表达式
这里写图片描述
图5. 2 DSB频域图像

5.3 双边带幅度调制Verilog实现

5.3.1 DDS模块实现

(1)dds_core.v
完成ROM地址改变的功能

`timescale 1ns/1ns
module dds_core_sin(
    CLK,    //clock
    RST,    //button reset, high level reset
//  FWEN,   //button frequency word update enable, high level enable
    FWIN,   //input frequency word
    CLKOUT, //output clock
    SINOUT, //sine signal output, 2's complement format
    AccCNT
);

input CLK;
input RST;
//input FWEN;
input[31:0] FWIN;
output CLKOUT;
output[9:0]SINOUT;
output[31:0]AccCNT;

parameter FW_WL=32; // frequency word 32bit
parameter RA_WL=10; // rom address input length
parameter RD_WL=10; // rom data output length

//reg   [FW_WL-1 : 0] fwin_R;   // frequency word 
reg [FW_WL-1 : 0] acc_R;    // acc register record frequency + acc
reg [RA_WL-1 : 0] addr_R;   // addr_R related to rom input 
reg [RD_WL-1 : 0] sinout_R; // sinout_R is the register of rom output
wire [RD_WL-1 : 0] romout_W;// related to rom output

always @ (posedge CLK ) begin
    if(!RST) 
    begin // all registers clear out
//      fwin_R <= 0;
        acc_R <= 0;
        addr_R <= 0;
        sinout_R <= 0;
    end
    else begin
        // fwin_R update
//      if(FWEN) fwin_R <= #5 FWIN;
//      else fwin_R <= #5 fwin_R;
//      fwin_R <= FWIN;
        // acc_R update
//      acc_R <= fwin_R + acc_R;
        acc_R <= FWIN +acc_R;
        // addr_R update, the acc_R high RA_WL is rom address
        addr_R <= acc_R[FW_WL-1 : FW_WL-1 - (RA_WL-1)];

        // sinout_R update
        sinout_R <= romout_W;

    end
end
sine_rom_10bit 
  • 0
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是单音AM、SSB信号和语音AM、SSB信号调制代码,使用MATLAB实现单音AM信号调制: ```matlab clear all; close all; % 设定参数 fs = 10000; % 采样率 fc = 1000; % 载波频率 fm = 100; % 调制信号频率 Am = 2; % 调制信号振幅 Ac = 5; % 载波振幅 % 生成调制信号 t = 0:1/fs:1; % 时间序列 m = Am*sin(2*pi*fm*t); % 调制信号 % 生成载波信号 c = Ac*sin(2*pi*fc*t); % 载波信号 % AM调制 sAM = (1+m./Am).*c; % 画图 subplot(3,1,1) plot(t,m); xlabel('Time(s)'); ylabel('Amplitude'); title('Modulating signal'); subplot(3,1,2) plot(t,c); xlabel('Time(s)'); ylabel('Amplitude'); title('Carrier signal'); subplot(3,1,3) plot(t,sAM); xlabel('Time(s)'); ylabel('Amplitude'); title('AM signal'); ``` SSB信号调制: ```matlab clear all; close all; % 设定参数 fs = 10000; % 采样率 fc = 1000; % 载波频率 fm = 100; % 调制信号频率 Am = 2; % 调制信号振幅 Ac = 5; % 载波振幅 % 生成调制信号 t = 0:1/fs:1; % 时间序列 m = Am*sin(2*pi*fm*t); % 调制信号 % 生成载波信号 c = Ac*sin(2*pi*fc*t); % 载波信号 % SSB调制 sSSB = hilbert(m).*exp(i*2*pi*fc*t) + hilbert(-m).*exp(-i*2*pi*fc*t); % 画图 subplot(3,1,1) plot(t,m); xlabel('Time(s)'); ylabel('Amplitude'); title('Modulating signal'); subplot(3,1,2) plot(t,c); xlabel('Time(s)'); ylabel('Amplitude'); title('Carrier signal'); subplot(3,1,3) plot(t,real(sSSB)); xlabel('Time(s)'); ylabel('Amplitude'); title('SSB signal'); ``` 语音AM信号调制: ```matlab clear all; close all; % 载入音频文件 [x,fs] = audioread('audio.wav'); % 设定参数 fc = 5000; % 载波频率 Am = max(abs(x)); % 调制信号振幅 Ac = 1; % 载波振幅 % AM调制 t = 0:1/fs:(length(x)-1)/fs; % 时间序列 c = Ac*sin(2*pi*fc*t); % 载波信号 sAM = (1+x./Am).*c; % 画图 subplot(2,1,1) plot(t,x); xlabel('Time(s)'); ylabel('Amplitude'); title('Original signal'); subplot(2,1,2) plot(t,sAM); xlabel('Time(s)'); ylabel('Amplitude'); title('AM signal'); ``` 语音SSB信号调制: ```matlab clear all; close all; % 载入音频文件 [x,fs] = audioread('audio.wav'); % 设定参数 fc = 5000; % 载波频率 Am = max(abs(x)); % 调制信号振幅 Ac = 1; % 载波振幅 % SSB调制 t = 0:1/fs:(length(x)-1)/fs; % 时间序列 c = Ac*sin(2*pi*fc*t); % 载波信号 sSSB = hilbert(x).*exp(i*2*pi*fc*t) + hilbert(-x).*exp(-i*2*pi*fc*t); % 画图 subplot(2,1,1) plot(t,x); xlabel('Time(s)'); ylabel('Amplitude'); title('Original signal'); subplot(2,1,2) plot(t,real(sSSB)); xlabel('Time(s)'); ylabel('Amplitude'); title('SSB signal'); ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值