Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • CSPM includes a function that will create a moving average.
  • Start CSPM (to add the folder to the path)
  • Load the variable into matlab; Import data, and select an excel or text file.
  • Get the variable name of the timetrend
  • Set the number of samples over which to calculate the average
>>num>> num_samples4window = 20;
  • Run the following command
    • "t" is the name of the timetrend variable in matlab workspace
>>tma>> tma = movingaverage( t, num_samples4window )

The filtered timetrend is saved in the variable "tma"

To view the results, run the following commands:

>> figure('Name','Before/after smoothing')
>> plot(t,'b')
>> hold on
>> plot(tma,'r')
>>legend {'Original' 'Smoothed'}