How to generate signal with seasonal and diurnal component?
3 views (last 30 days)
Show older comments
Charles Barbier Mr
on 13 Feb 2017
Edited: Charles Barbier Mr
on 8 Apr 2017
If we had a time series of hourly air temperature measurements and then plotted the entire series it would look similar to a bell shaped curve
i.e.
a = 0; b = 30;
x = a + (b-a) * rand(1, 8760);
m = (a + b)/2;
s = 12;
p1 = -.5 * ((x - m)/s) .^ 2;
p2 = (s * sqrt(2*pi));
f = exp(p1) ./ p2;
plot(x,f,'.')
with the maximum values occurring in mid summer and lowest values during the winter. However, by zooming in on specific days we would see that the temperature also fluctuates between the day and the evening where maximum temperatures would occur at approximately 15:00 and minimum temperature at approximately 06:00. So, my question is how would I generate this series, i.e. a time series which had a maximum value of say 30 degrees in mid summer i.e. value (8760/2) and also had the daily pattern mentioned above incorporated into the overall pattern?
0 Comments
Accepted Answer
Bjorn Gustavsson
on 13 Feb 2017
Well a first stab would be to look at this as a function that has a daily variation, i.e. a time-period of 24 hours, and then perhaps bot the average and amplitude of that curve would have a 365 day variation. Perhaps something like this:
t = 0:(24*365);
T = -4*cos(t*2*pi/(24*365))-6*(1-0.25*cos(t*4*pi/(24*365))).*cos(t*2*pi/24);
Or whatever suits your needs/looks like a reasonable representation of what you're supposed to model.
HTH
0 Comments
More Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!