# Analysis of the Quantization Noise in Discrete Wavelet Transform Filters for 3D Medical Imaging
## 2 Materials and Methods
However, quantization noise occurs due to the digital format of wavelet filters coefficients representation in practice. Quantization noise distorts all image decomposition coefficients \(LLL,LLH,LHL,LHH,HLL,HLH,HHL,HHL\) and \(HHH\) as well as reconstructed image \(\widetilde{I}\). The images DWT result may have a quality unacceptable for the task depending on the magnitude of quantization noise. The question arises about the minimum bit-width of wavelet filters coefficients \(f_{F,i}\), necessary for efficient software and hardware implementation of 3D images DWT on modern devices and enough for high-quality images processing. The speed of operations with a fixed-point number is higher than with a floating-point number on modern devices. This can be used to develop 3D medical imaging devices. Therefore, wavelet filters coefficients are quantized and converted into a fixed-point format in the proposed method by scaling by \(2^{n}\) and rounding up  
\[f_{F,i}=\left[2^{n}f_{F,i}\right]. \tag{2}\]  
Bit-width \(r\) of quantized wavelet filters coefficients \(f_{F,i}^{*}\) can be determined by the formula \(r=n+1\) in this case. The digital image \(I^{*}\) processed according to the scheme in Figure 2 using quantized wavelet filters coefficients \(f_{F,i}^{*}\). Voxel values of an image \(I^{*}\) should be normalized by scaling by \(2^{-6n}\) (\(2^{-n}\) for each convolution, according to the scheme from Figure 2) and rounding down  
\[\widetilde{I}=\left\lfloor 2^{-6n}I^{*}\right\rfloor. \tag{3}\]  
We get only integers as a result of images DWT with unquantized coefficients. The quantization error of the wavelet filters coefficients rounded up is strictly redundant. Rounding down of the DWT results minimizes this error and cannot cause an error by itself. Rounding up and down operations are performed by discarding the fractional part of the number with the addition of one in the case of rounding up an integer. The rounding errors will have different signs and partially compensate each other for rounding in different directions. Rounding operations in this order require fewer resources for hardware implementation than rounding operations to the nearest integer. This is due to the fact wavelet filter coefficients are known a priori and their quantization with rounding up can be made in advance. Thus, wavelet filters coefficients will be used in the form of constants in the software and hardware part. The convolution is performed using arithmetic logic devices, and its result is rounded down by simply discarding the fractional part and does not require additional hardware and time costs. We used the peak signal-to-noise ratio (\(PSNR\)) between two images (original image \(I\) and processed image \(\widetilde{I}\)) to quantify the image processing quality. The \(PSNR\) logarithmic nature makes it possible to clearly interpret results that differ slightly from each other. Other metrics usually only show a big difference. This characteristic is measured in decibels (dB) and is calculated by the following formula [49]  
\[PSNR=10\log_{10}\left(\frac{\left(2^{B}-1\right)^{2}}{MSE}\right)=10\log_{10} \left(\frac{M^{2}}{MSE}\right),\]where: \(B\) is the image BPC; \(M\) is the maximum brightness of the image voxels (for example, \(B=8\) and \(M=2^{8}-1=255\) for 8-bit grayscale image and 24-bit RGB image); \(MSE\) is the mean square error of brightness, which is calculated for grayscale (\(MSE_{\textit{grayscale}}\)) [50] and color (\(MSE_{\textit{color}}\)) [51] 3D images by formulas  
\[MSE_{\textit{grayscale}}=\sum\limits_{x=0}^{X-1}\sum\limits_{y=0}^{Y-1}\sum \limits_{z=0}^{Z-1}\frac{\big{(}I(x,y,z)-\overline{I}(x,y,z)\big{)}^{2}}{X \cdot Y\cdot Z},\]  
\[MSE_{\textit{color}}=\frac{1}{C}\sum\limits_{c=1}^{C}\sum\limits_{x=0}^{X-1} \sum\limits_{y=0}^{Y-1}\sum\limits_{z=0}^{Z-1}\frac{\big{(}I(x,y,z,c)-\overline {I}(x,y,z,c)\big{)}^{2}}{X\cdot Y\cdot Z}.\]  
The value \(PSNR=\infty\) for identical images.