question about the signal smoothing example

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?

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

For the first question, the data is recorded hourly, so the samples are done in 1:31*24. However, in the display, the x axis is labeled as days, that’s why it needs to be divided by 24.

For the second question, the N is basically the window length you use to smooth the data…..

SEE COMPLETE ANSWER CLICK THE LINK

https://www.matlabsolutions.com/resources/question-about-the-signal-smoothing-example.php

--

--

--

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Create A SQL database in Python

Why Google PubSub? — Streaming financial data thru PubSub to BigQuery

Very Interesting #0

Setting Up A SOCKS v5 Proxy For Web Surfing

When Software Is Not Soft Anymore: The Nature of Software Complexity.

TWiGCP — “Introducing Chronicle Detect and AI Platform Prediction GA”

MetaModernism and Incremental Development

Elementor Help & Training

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Technical Source

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

More from Medium

Introduction to Pandas

APPLICATION OF PYTHON IN COVID SPREAD ANALYSIS

Why do I get “cannot load an object of class ‘compactcl?assificati?on

Python — Everything is object