
这个程序有什么问题,为什么matlab运行结果只有ans=0?
T=10e-6;%pulseduration10usB=30e6;%chirpfrequencymodulationbandwidth30MHzK=B/T;%chirps...
T=10e-6; %pulse duration10us
B=30e6; %chirp frequency modulation bandwidth 30MHz
K=B/T; %chirp slope
Fs=1*B;Ts=1/Fs; %sampling frequency and sample spacing
N=T/Ts;
t=linspace(-T/2,T/2,N);
St=exp(j*pi*K*t.^2); %generate chirp signal
y=zeros(1,N);
y=real(St);
z=zeros(1,N);
z=imag(St);
figure(1)
subplot(311)
plot(t*1e6,y);
xlabel('Time in u sec');
title('Real part of chirp signal');
grid on;axis tight;
subplot(312)
plot(t*1e6,z);
xlabel('Time in u sec');
title('imag part of chirp signal');
grid on;axis tight;
subplot(313)
freq=linspace(-Fs/2,Fs/2,N);
f=zeros(1,N);
f=fftshift(abs(fft(St)));
plot(freq*1e-6,f);
xlabel('Frequency in MHz');
title('Magnitude spectrum of chirp signal');
grid on;axis tight; 展开
B=30e6; %chirp frequency modulation bandwidth 30MHz
K=B/T; %chirp slope
Fs=1*B;Ts=1/Fs; %sampling frequency and sample spacing
N=T/Ts;
t=linspace(-T/2,T/2,N);
St=exp(j*pi*K*t.^2); %generate chirp signal
y=zeros(1,N);
y=real(St);
z=zeros(1,N);
z=imag(St);
figure(1)
subplot(311)
plot(t*1e6,y);
xlabel('Time in u sec');
title('Real part of chirp signal');
grid on;axis tight;
subplot(312)
plot(t*1e6,z);
xlabel('Time in u sec');
title('imag part of chirp signal');
grid on;axis tight;
subplot(313)
freq=linspace(-Fs/2,Fs/2,N);
f=zeros(1,N);
f=fftshift(abs(fft(St)));
plot(freq*1e-6,f);
xlabel('Frequency in MHz');
title('Magnitude spectrum of chirp signal');
grid on;axis tight; 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询