0 like 0 dislike
0 like 0 dislike
How to smooth a discrete graph using operator and matrix

1 Answer

0 like 0 dislike
0 like 0 dislike
Look into convolutions, not sure if that is what you want tho, but it is how i know to do it. The 3×3 matrix is basicly like a gaussian blur filter for pictures.  Imagine you take your operator/kernel and you slide it over your signal.     
     
Lets say [2, 5, 3, 4, 1].     

Add padding on the edges = [0, 2, 5, 3, 4, 1, 0]           
    
First value in new smoothed signal is calculated:     1/4•0 + 1/2•2 + 1/4•5 = [2.25, ?, ?, ?, ?]    
  
Move the kernel one step so the middle value is over 5.  Then repeat:    
  1/4•2 + 1/2•5 + 1/4•3 = [2.25, 3.75, ?, ?, ?]     
   .     
  
This is how the algorithm works if you wanna program it. You can write it as a matrix multiplication, Notice each column is one shift to the right from your original signal, for each step.  
      
               | 0 2 5 3 4 |     

[1/4, 1/2, 1/4] •  |  2  5  3  4  1  |   

               | 5 3 4 1 0 |      
   
I wrote it on my phone so it might look weird, and there is probably better ways to do it, but this works as a smooth filter as you asked.

No related questions found

24.8k questions

103k answers

0 comments

33.7k users

OhhAskMe is a math solving hub where high school and university students ask and answer loads of math questions, discuss the latest in math, and share their knowledge. It’s 100% free!