question about the signal smoothing example
Show older comments
Hello,
I have a question about the signal smoothing example given in the documentation of Matlab.
load bostemp
days = (1:31*24)/24;
plot(days, tempC)
axis tight
ylabel('Temp (\circC)')
xlabel('Time elapsed from Jan 1, 2011 (days)')
title('Logan Airport Dry Bulb Temperature (source: NOAA)')
I understand that this example wants to emphasize that the measurements are taken 24 hours a day, 31 days for January. So the variable 'days' ranges from 1 to 31*24. But why divide it by 24?
Also,
hoursPerDay = 24;
coeff24hMA = ones(1, hoursPerDay)/hoursPerDay;
avg24hTempC = filter(coeff24hMA, 1, tempC);
plot(days,[tempC avg24hTempC])
I understand that this example refers to the moving average of length N (in this case N = 24). I don't understand why there is a need to set N = 24. Why can't it be just N = 1?
Thanks for your insights
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!