Analyzing Cyclic Behavior of the Temperature in an Office Building

260 Views Asked by At

let us consider following code

>> load officetemp.mat
Fs = 1/(60*30);   % Sample rate is 1 sample every 30 minutes
t = (0:length(temp)-1)/Fs;
>> NFFT = length(temp);              % Number of FFT points
F = (0 : 1/NFFT : 1/2-1/NFFT)*Fs; % Frequency vector

TEMP = fft(temp,NFFT);
TEMP(1) = 0; % remove the DC component for better visualization

helperFrequencyAnalysisPlot2(F*60*60*24*7,abs(TEMP(1:NFFT/2)),...
  'Frequency (cycles/week)','Magnitude',[],[],[0 10])
>> 

it is used to Analyzing Cyclic Behavior of the Temperature in an Office Building ,Problem statement is that

a set of temperature measurements in an office building during the winter season. Measurements were taken every 30 minutes for about 16.5 weeks. Look at the time domain data with the time axis scaled to weeks. Could there be any periodic behavior on this data?

after running that code we have following graphic enter image description here

while it is easy to use this code, i want to use periodogram , for which power spectrum estimation with defualt rectangular window and default DFT point is

[pxx,f]=periodogram(temp,[],[],Fs); plot(f,pxx) but figure is that enter image description here

could you help me please what happens? thanks in advance, for addition information, question is taken from here

http://www.mathworks.com/help/signal/examples/practical-introduction-to-frequency-domain-analysis.html