| Previous | Table of Contents | Next |
Figure 11-4 lists each input value and graphs its corresponding output value. The indicator below the input value indicates whether the output value:
Looking at the output curve, only 22 of the 59 output points differ from their original input value so the output curve resembles the input curve. The differences occur at points preceding input curve ascents and descents. These differences make the fluctuation edges more gentle, helping dampen rapid curve oscillations. In other words, the output curve is smoother than the input curvehence the name smoothing.
Now lets consider another averaging approach. This time, to generate output values, add three adjacent sequence number values to the middle sequence numbers value and divide by 4 using integer arithmetic. Here we use the middle sequence numbers value twice so we denote the process filter kernel as:
1/4 [+1, +2, +1]
Figure 11-5 shows the output.
14 |------------------------------------------------------------ | 14 13 |------------------------------------------------------------ | 13 12 |------------------------------------------------------------ | 12 11 |------------------------------------------------------------ | 11 10 |------------------------------------------------------------ | 10 9 |------------------------------------------------------------ | 9 8 |---------*--------**-------*-----*-----*----------*--------- | 8 7 |-------***-------****------*-----**---***---*-----***------- | 7 6 |------*****-----******----***---***---********---*****------ | 6 5 |-----******----*******----***---****-*********---******----- | 5 4 |----*******---*********---***---***************--*******---- | 4 3 |---*********-**********--*****-****************--********--- | 3 2 |--********************************************************-- | 2 1 |-**********************************************************- | 1 0 +------------------------------------------------------------------------+ 0 Input:012345678882244668888642228882228884448886668642088876543210 ========-=-+=-=-=-==-====+-=-+=+-=-+=+-=-===-===+-=-========
Figure 11-5: Smoothing 1/4 [+1,+2,+1] output array
Here we obtain a curve similar to the previous one but not as smooth. Using the middle sequence number twice and dividing by 4 allowed the middle sequence numbers to influence the average as much as the other two numbers combined. This mathematical weighting, therefore, favors the middle sequence number, allowing it to dominate the output value.
Finally, we consider the following filter kernel:
1/2 [+1,0,+1]
Here, the middle sequence number value is not used and the values on both its sides are averaged. Figure 11-6 on the following page depicts the result.
14 |------------------------------------------------------------ | 14 13 |------------------------------------------------------------ | 13 12 |------------------------------------------------------------ | 12 11 |------------------------------------------------------------ | 11 10 |------------------------------------------------------------ | 10 9 |------------------------------------------------------------ | 9 8 |---------*--------**-------*-----*-----*----------*--------- | 8 7 |-------***------*****------*-----*-----***-*------***------- | 7 6 |------****------******-----*-----***-*********----****------ | 6 5 |-----*******--********---*****-*****-*********--*-*****----- | 5 4 |----********--*********--*****-****************-********---- | 4 3 |---*********************-*****-****************-*********--- | 3 2 |--********************************************************-- | 2 1 |-**********************************************************- | 1 0 +------------------------------------------------------------+ 0 Input:012345678882244668888642228882228884448886668642088876543210 ========-=-++-+-+-==-==+=+-=-+=+-=-+=+-=-+=+-===+-=-========
Figure 11-6: Smoothing 1/2 [+1,0,+1] output array
Here we get yet another different curve that does resemble the first but differs from the others. So, it is clear that using different algorithms can easily produce different results even though they are all equally valid.
Before moving on, it is important to note one important conceptlocality. When calculating an output sequence number, the computation only uses sequence numbers near the current input sequence number. The previous examples only considered adjacent sequence numbers. But filter kernels can include points farther away, introducing more averaging. This de-emphasizes local output sequence number variations around any input sample point.
| Previous | Table of Contents | Next |