% zsqEg7_7.m Fd=1e3; %码元时隙为1ms Fs=Fd*20; %在一个码元时隙内采样20次 delay=10; %滤波器延时为10个码元时隙宽度 for r=[0, 0.25, 0.5, 0.75, 1] %滚降系数为0,0.2... % zsqEg7_7.m
Fd=1e3; %码元时隙为1ms
Fs=Fd*20; %在一个码元时隙内采样20次
delay=10; %滤波器延时为10个码元时隙宽度
for r=[0, 0.25, 0.5, 0.75, 1] %滚降系数为0,0.25,0.5,0.75和1
num = rcosine(Fd,Fs, 'fir/normal',r,delay);
t=0:1/Fs:1/Fs*(length(num)-1);
figure(1); plot(t,num); axis([0 0.02 -0.3 1.1]);hold on;
Hw=abs(fft(num,1000));
f=(1:Fs/1000:Fs)-1;
figure(2); plot(f,Hw); axis([0 1500 0 22]);hold on;
end
Fd=1e3; %码元时隙为1ms
Fs=Fd*20; %在一个码元时隙内采样20次
delay=10; %滤波器延时为10个码元时隙宽度
r=[0,0.25,0.5,0.75,1]
for i=1:length(r) %滚降系数为0,0.25,0.5,0.75和1
num = rcosine(Fd,Fs, 'fir/normal',r(i),delay);
t=0:1/Fs:1/Fs*(length(num)-1);
figure(1);
plot(t,num);
axis([0 0.02 -0.3 1.1]);
hold on;
Hw=abs(fft(num,1000));
f=(1:Fs/1000:Fs)-1;
figure(2);
plot(f,Hw);
axis([0 1500 0 22]);
hold on;
end
应该这么写,for循环不能你这么用