|
发表于 2009-5-18 08:37:32
|
显示全部楼层
似乎过于简单了一些。一个PPT,一个WORD,一小段程序如下。
clc
close all
clear all
t = 0:0.00001:0.001;
Fc1 = 1000;
Fc2 = 2000;
Fc3 = 3000;
Fc4 = 4000;
Fc5 = 5000;
Fs = 12000;
y1 = 1; y2 = 0; y3 = 0; y4 = 0; y5 = 0; Y = 0; y = 0;
x1 = cos(2*pi*1000*t);
in_p = input('\nDo you want to enter first primary user Y/N: ','s');
if(in_p == 'Y' | in_p == 'y')
y1 = ammod(x1,Fc1,Fs);
end
in_p = input('Do you want to enter second primary user Y/N: ','s');
if(in_p == 'Y' | in_p == 'y')
y2 = ammod(x1,Fc2,Fs);
end
in_p = input('Do you want to enter third primary user Y/N: ','s');
if(in_p == 'Y' | in_p == 'y')
y3 = ammod(x1,Fc3,Fs);
end
in_p = input('Do you want to enter fourth primary user Y/N: ','s');
if(in_p == 'Y' | in_p == 'y')
y4 = ammod(x1,Fc4,Fs);
end
in_p = input('Do you want to enter fifth primary user Y/N: ','s');
if(in_p == 'Y' | in_p == 'y')
y5 = ammod(x1,Fc5,Fs);
end
y = y1 + y2 + y3 + y4 + y5;
while(1)
Pxx = periodogram(y);
Hpsd = dspdata.psd(Pxx,'Fs',Fs);
plot(Hpsd); |
|