How to generate signal with seasonal and diurnal component?

4 次查看(过去 30 天)
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?

采纳的回答

Bjorn Gustavsson
Bjorn Gustavsson 2017-2-13
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 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by