In this section, we will take a look at the frequency spectrum of a JWST image, and attempt to modify it in the frequency domain, before returning it to the 'time'-domain. As an interesting exercise, in addition to analyzing the frequency spectrum of the JWST images, we also take a brief look at images from the Hubble space telescope below. Due to the different lens shapes on the JWST and the Hubble space telescopes, different diffraction patterns are observed when comparing images. While the JWST images have the overarching 6-pointed shape (with the horizontal line additionally), the Hubble pattern is just a 4-pointed pattern diagonally.
We began by taking the Fast Fourier Transform (FFT) of each of the three channels in the image, before centering them within the frequency spectrum plot. Interestingly, the faint shape of the diffraction pattern can be seen in each frequency spectrum. From this faint pattern, we began an approach of attempting to suppress the diffraction pattern through frequency domain manipulation, in the hope that it would eliminate the pattern in the 'time'-domain image. Below, the left images are from the JWST, and the right images are from Hubble.
A JWST image [7]
A Hubble image [8]
The frequency representation allowed us to analyze the image in terms of its spatial frequencies, with low frequencies near the center and high frequencies spread outward after applying fftshift, which is a MATLAB function that rearranges the output of the Fast Fourier Transform (FFT) so that the zero-frequency component is centered in the output matrix. This reorganization is especially useful for visualizing and analyzing the frequency content of a signal or an image. The FFT decomposes the image into sinusoidal patterns of varying frequencies and directions, which made it possible to target specific angular artifacts.
Next, we created a suppression mask to attenuate frequencies along the specified angles (0°, 45°, 90°, etc.) while preserving the rest. Using the radial distance and angle for each frequency component, we defined a narrow angular window (±2°) around each target angle. Frequencies within this angular range and beyond a low-frequency cutoff radius (30 pixels) were flagged for suppression. This ensured that the suppression only affected the unwanted spikes and did not distort the low-frequency content critical for image structure.
The suppression mask was applied to the FFT data by multiplying it element-wise with the frequency spectrum. This attenuated the amplitude of the targeted frequencies, effectively reducing their influence on the final image. The low-frequency cutoff further protected important details from being altered, ensuring that the mask only impacted the high-frequency artifacts along the specified directions.
Finally, the filtered frequency data was transformed back into the spatial domain using an inverse FFT. The result was a cleaned image where the directional spikes had been suppressed without significant loss of detail. Visualizing the frequency spectra before and after filtering highlighted the effectiveness of the suppression, showing reduced intensity along the targeted angles. The below figures show the results of the frequency suppression for the JWST image, with only mild change noticed on the diffraction pattern.
Note: ChatGPT was used sparingly to generate MATLAB code for angular suppression in this section.