Читать книгу Inverse Synthetic Aperture Radar Imaging With MATLAB Algorithms - Caner Ozdemir - Страница 47
Matlab code 1.2 Matlab file “Figure1‐2.m”_________________________________
Оглавление%-------------------------------------------------------- % This code can be used to generate Figure Figure 1.2 %-------------------------------------------------------- % This file requires the following files to be present in the same % directory: % %prince.wav clear all close all % Read the sound signal "prince.wav" [y,Fs] = audioread('prince.wav'); sound(y,Fs); %play the sound N=length(y); t=0:.8/(N-1):.8; %form time vector % FREQUENCY DOMAIN SIGNAL Y=fft(y)/N; % Calculate the spectrum of the signal df=1/(max(t)-min(t)); % Find the resolution in frequency f=0:df:df*(length(t)-1); % Form the frequency vector plot(f(1:2:N)*1e-3,abs(Y(1:(N+1)/2)),'k') %downsample for plotting axis([-1 20 0 .035]) grid minor set(gca,'FontName', 'Arial', 'FontSize',12, 'FontWeight','Bold'); xlabel('frequency, KHz'); ylabel('amplitude'); title('\itfrequency domain signal');