I'm learning signal processing on my own and I'm in the filters, I chose the moving average because it seems the simplest.
What I want to know is how to draw the frequency response of the moving average.
I'm using p5j to draw. if you do not know p5j is a program to draw with code.
This is my sketch
What I do is create a square wave and apply the moving average, after that I would like to draw the frequency response.
The sine wave above is just to show how to draw a can ignore it if it wants
Feel free to edit the code
Do not forget to pass me the code when I finish drawing the diagram above