Transcript

% PERIODOGRAMclc;clear all;close all;T=1;fs=1000;t=0:1/fs:T;N=length(t);f1=input('Enter freq:');x=randn(size(t))+sin(2*pi*f1*t);plot(t,x);xlabel('time');ylabel('amplitude');title('input signal');figure;XX=fft(x,N);X=(abs(XX)).^2;P=X/N;disp(P);f=(1:N)/T;Pdb=10*log10(P);plot(f,Pdb);xlabel('Frequency(Hz)---->');ylabel('Power----->');title('Periodogram power spectral density estimate');% USING PERIODOGRAM FUNCTIONfigure;periodogram(x,[],'twosided',N,fs);


Top Related