Plot autocorrelation and power spectrum
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aik Hong
am 15 Dez. 2013
Kommentiert: Aik Hong
am 16 Dez. 2013
Hi..i'm a beginner in using Matlab. I'm currently trying to generate a Gaussian random numbers, then use it as an input to a low pass filter, cut-off frequency 1000Hz. I have the random number generated as: : f = randn(1000,1) * sqrt(2) + 0; I'd like to ask how can i proceed from here to calculate and plot the autocorrelation and power spectrum at input/output of the filter.
0 Kommentare
Akzeptierte Antwort
Wayne King
am 15 Dez. 2013
If you have the Signal Processing Toolbox, simply use xcorr() and periodogram()
x = sqrt(2)*randn(1000,1);
Numlags = 50;
[xc,lags] = xcorr(x,Numlags,'coeff');
stem(lags(51:end),xc(51:end))
% power spectrum
Fs = 1; % sampling frequency
[Pxx,F] = periodogram(x,[],length(x),Fs);
figure;
plot(F,10*log10(Pxx))
4 Kommentare
Wayne King
am 16 Dez. 2013
You need more information than that. You need to know minimally the sampling frequency.
Weitere Antworten (1)
Wayne King
am 16 Dez. 2013
It depends on what you have exported. If you exported a filter object -- I'll assume this.
Let Hd be your filter object
x = randn(1000,1); % white noise input 1,000 samples in length
y = filter(Hd,x);
Siehe auch
Kategorien
Mehr zu Filter Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

