当前位置:   article > 正文

单路DDS与多路DDS_多相dds信号合成

多相dds信号合成

不考虑频率分辨率、量化噪声,仅为验证之用

clc;clear all;close all;

%-- 生成DDS_ROM
N = 16384;
sin_rom = zeros(1,N);
cos_rom = zeros(1,N);
for m=0:N-1
    sin_rom(1,m+1) = sin(m/N*2*pi);
    cos_rom(1,m+1) = sin(m/N*2*pi);
end

%-- 单路DDS输出
FS = 5000;
f  = 1000;
freq_word  = round(f/FS*N);
phase_word = 0;
phase      = 0;
single_dds_sig = zeros(1,N);
for m=0:N-1
    if m== 0
        phase = freq_word + phase_word;
    else
        phase = freq_word + phase;
    end
    phase_addr = mod(phase,N);
    if phase_addr == 0
        phase_addr = 1;
    end
    single_dds_sig(1,m+1) = sin_rom(1,phase_addr);
end
y = abs(fft(single_dds_sig));
figure;
plot(20*log10(y/max(y)));
title('单路DDS输出');

%-- 多路DDS输出
FS  = 5000;
f   = 1000;
NUM = 16;
freq_word  = NUM*round(f/FS*N);
phase_word = linspace(0,NUM-1,NUM)*round(f/FS*N);
phase      = -linspace(1,NUM,NUM)*round(f/FS*N);

multi_dds_sig = zeros(NUM,N/NUM);
for m=1:NUM
    for k=0:N/NUM-1
        if k==0
            phase(1,m) = freq_word + phase_word(1,m);
        else
            phase(1,m) = freq_word + phase(1,m);
        end
        phase_addr = mod(phase(1,m),N);
        if phase_addr == 0
            phase_addr = 1;
        end
        multi_dds_sig(m,k+1) = sin_rom(1,phase_addr);
    end
end
multi_dds_sig_new = reshape(multi_dds_sig,1,N);
y = abs(fft(multi_dds_sig_new));
figure;
plot(20*log10(y/max(y)));
title('多路DDS输出');

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号