Fixing Cassini’s Two Hertz Noise
Before the Cassini orbiter spacecraft was sent on its way to Saturn, all its components and systems were thoroughly tested on the ground, at JPL and other places. Everything was fine. Then not long after the launch in 1997, it became apparent that the NAC imaging system had a problem.
Cassini has two cameras [[[https://ciclops.org/iss/iss.php.html]]]. The “NAC” is the Narrow Angle Camera, a Ritchey-Cretien telescope with a focal length of 2 meters and a field of view of 0.35°. It is the main camera to be used for most of the science images and many public release photos. Its partner is the WAC, a leftover from the Voyager program with new electronics. It has a field of view of 3.5° and best for capturing shots of all of Saturn and shots of multiple moons when the positions are right. But there weren’t going to any useful science or public release images with those ugly soft-edged horizontal bars in the NAC images!
As the new guy hired into CICLOPS, the Cassini Imaging Central Laboratory for Operations in Boulder Colorado, my first job was to develop a way to remove these bars we called “The Two Hertz Noise.” This took plenty of analysis, some creative thinking and drawing upon other areas of knowledge to develop a filter to do this. With this filter, we could routinely remove those bars from every NAC image with barely a trace. This was ready for use long before Cassini arrived at Saturn in 2004.
Analyzing a few typical images, I could see that the 2Hz noise was additive, always adding or subtracting a few counts to every pixel, for dark sky pixels the same as for bright pixels of Saturn’s atmosphere. It was generally constant along one row, changing slightly from one row to the next. Over the whole image, varying vertically, cycling irregularly, on a scale of 20 to 30 or so rows. It would add or subtract up to 2 or 3 DN to each pixel, depending on certain camera settings.
“DN” which stands for “Data Number.” It’s what we called the numbers in the digitized image, the straight binary values, before any conversion to physical units. The digitizer used 12 bits, so values went from zero to 4095. We used “DN” as if it were some kind of unit, as in “the average brightness of Enceladus in this image is about 2500 DN.”
While the noise, or “hum” as I sometimes call it, looks roughly like a sine wave added to the image, closer analysis showed it to be at least two sine waves with similar spatial frequencies, adding in places and nearly canceling in other places.
The reason we called it “Two Hertz” has to do with the sensor readout process. After the camera’s shutter has opened and closed to capture one image, the pixels of the 1024×1024 CCD sensor hold various charges, proportional to the amount of light each has captured. These charges are shifted horizontally from cell to cell, with the charge of the cell at the end of the row being pushed out to be amplified and digitized. Once the entire row of 1024 cells has been read out, all the pixels in all rows above are shifted down one place. The second row of the image, now at the bottom, is shifted out like before. Repeat a total of 1024 times to read out the entire image.
This isn’t exactly true in detail, but close enough for now. I will describe certain extras later.
As you can imagine, this readout takes time. Fast by Human standards, but slow in computers-and-electronics time. It can take a few seconds. The 2Hz Noise was suspected to be caused by some stray electric or magnetic field influencing the sensitive amplifier reading the CCD’s charges, or some other spacecraft system putting interference on a power supply line. If that were so, and taking into account the speed at which pixels were read out, that interference would have had a frequency of about 2 cycles per second, 2 Hz.
We never did determine beyond any doubt what was the source of the interference. It could have been some defect inside the amplifier, or digitizer. Maybe a broken power supply decoupling capacitor? But at least it was steady over time. During Cassini’s entire mission, including extended missions, the 2Hz remained without change in all NAC images.
From one image to the next, the exact pattern and position of the 2Hz noise shifted randomly. It was not a fixed pattern we could extract just once, then subtract from all raw images ever received. As I continued to examine it, I saw that it wasn’t just two sine waves, but a bit messier.
Bad Idea: Notch Filtering
Given an image like this,
The first thing many engineers and physicists would say is: use a notch filter. That is, take a Fourier Transform, look for the peak at the frequencies corresponding to the horizontal bands, and replace it with zeros, or some average of nearby frequencies. An Inverse Fourier Transform will produce a cleaner image.
But this does not work!
The interference is faint, and Cassini will provide hundreds of thousands of images showing very bright, high contrast, hard-edged objects such as Saturn and its moons. Anyone who has worked with audio signals and filters, or signal integrity in digital logic, knows that strong hard transitions pushed through almost any kind of filter will lead to ringing. This is the phenomenon of waves appearing for some distance around a spike or square step edge.
Technically, yes you removed the frequencies corresponding to the interference, but you need all the frequencies that can exist to accurately reproduce hard-edged things like Saturn’s edge (“limbs” in astro jargon), rings, moons, and single-pixel dots like stars and the smaller more distant moons.
Good Idea: Recreate the Noise
Since those spatial frequencies at which the bars occur are also needed for a clean accurate image, I had to find another approach. The noise is additive, ever-shifting from image to image, but not changing in amplitude, and constant horizontally along each row. It’s fairly smooth, like a sine wave, more of a somewhat distorted sum of a few sine waves.
Instead of removing the noise, we identify and extract the noise. We may need to manipulate it, clean it, and then we subtract that clean noise from the original raw image.
We will treat the noise as the desired signal, and the rest of the image as noise!
This idea came to me from tinkering with antique vacuum tube radios long ago. Some would have a “Hum” knob, usually in back with other obscure adjustments meant for technicians to adjust. The 50/60Hz power from the wall power socket would create interference in the audio circuitry. The biggest offender, in many cases, was the AC voltage taken off the power transformer to supply current to the vacuum tube filaments. Also guilty were the unregulated “B” supply voltages of the simple power supplies of that era. Fluorescent lamps and electric fans in the room could also contribute. These influence the delicate radio and audio signals being processed, adding an annoying “hum” to the music, talk, sports and advertisements coming out of the speaker.
The “Hum” knob adjusted for some small amount of the 50/60 Hz from the power line to, in effect, be subtracted from the audio signal. Turn the knob to just the right spot, and you’d hear clean audio with little hum.
Solving our NAC images’ 2Hz noise problem requires identifying and extracting that noise. This can then be subtracted from the raw image to make a clean image.
Looking for Coherence
One type of thing to always look for to identify, extract or enhance a feature is coherence — sameness over position, or over time, discovered periodicities, or in any other way. We have sameness horizontally along each row, and near sameness when going vertically to the next row up or down. We do not have sameness from image to image, comparing the same pixel locations.
To extract the noise, for a first attempt, we could try averaging all the pixels along each row. For an image with plenty of dark sky, use just the dark sky pixels. Ignore any stars. If it were just one image, I could hand-paint a mask to select suitable dark sky areas and nothing else.
But this process must be automated, not only so I can work on thousands of images in the coming few years, but also so we can incorporate the filter into our official image calibration software, CISSCAL.
To automate this process, we could detect all pixels below some threshold, set several DN above the darkest pixels found in the image. This kinda worked, but there were problems. Lowering the threshold didn’t work, but rather messed with the good pixels to be averaged, clipping the peaks of the 2Hz noise while still letting a few faint stars through in the troughs.
The averages obtained this way didn’t clean the 2Hz out of the images. Averages are easily thrown off by small outliers. They’re thrown off a lot by big outliers, but we’ve thresholded them out. They’re thrown off if the random noise in the signal follows a weird distribution.
Median Filters
A median is the value for which half of the given input values are less than it, and half are more. It’s not pulled away by a few crazy outliers. The median value of all below-threshold pixels of one row gives a good estimate like the average but more reliable. In fact, I could raise the threshold a bit and see no change to the row median values. Nice!
Except there was another problem. I still couldn’t get clean images by subtracting this “hum” based on row medians. The results were better in some ways, but a bit worse in other ways.
Suppose you have some data, and you know somehow that the underlying reality of what you’re measuring in 12.4 units. The data comes from a sensor and digitizer, giving you this:
data = 10, 12, 15, 13, 9, 11, 14, 15, 13, 99
What’s the average? 21.1 (rounded to one digit after the decimal) which is way off. Obviously there’s an outlier, that last data point, so ignore it. Now the average is 12.444 which rounds down to 12.4, which is fine.
But we decide against using the average for good reasons such as avoiding effects of smaller outliers, quirks of the noise distribution, whatever. We use a median. What result to we find? 13.0 which is not quite right. It’s not as good as the mean! At least it stays the same if we include the outlier.
Pre-Smoothing
The problem with medians is that they report only the middle-most of the input values, which are all integers. In case of an even number of inputs, you may get the average of the two middle-most values, so you might get 11.5 or 12.5 from some data runs, if you don’t get an exact integer like 11, 12, or 13.
Solution: Create non-integer values by “pre-smoothing” the input. Apply a 3-element box averaging filter. At the ends, improvise somehow — let’s average the end value and its neighbor. Our pre-smoothed data looks like
data = 11.00, 12.33, 13.33, 12.33, 11.00, 11.33, 13.33, 14.00, 14.00
This has a median value of 12.333, which rounds to 12.3 which is close enough for government work (exactly what Cassini is!)
A better spread of non-integer values could be obtained by using a five-point box filter, or a triangle-shaped filter. These details didn’t matter much for my image processing, so long as a variety of fractional values between integers were generated for the median filter to pick from.
This turned out to be the key innovation making the final 2Hz Noise filter work.
DC Blocking and Final Smoothing
One final step in extracting the 2Hz noise signal was to measure an average over all rows, that is, the average dark pixel value for the whole image. We want to subtract just the 2Hz “signal,” that is, just the wavy variations we find. What we have so far is a row-by-row list of typical dark values, which has the waves riding on a constant level. There are multiple sources of this level:
- The sensor electronics applies a “bias” to all pixels, typically 20 to 30 DN (as I recall), so that in case there’s ever any problem with dark levels and noise, we have “elbow room” both above and below the value that counts as empty sky black, to do math, to analyze statistical distributions. Our image calibration process already takes into account this bias.
- There may be very faint light adding to the image. One source of that is stray light bounding around inside the camera. Another is that we may be pointing the camera toward the G ring, or E ring, or some other faint fuzzy thing, adding a few DN everywhere. The exact amount may or may not be of scientific interest, depending on the purpose of the image.
- The CCD sensor has “dark current” which is a reading above dark sky black due to quirks of how light-senstive semiconductors work. Even with the shutter closed, and if we set the bias to zero, we’d still read a small value that increases roughly in proportion to the exposure duration. This is another known phenomenon we allow for and subtract during the calibration process.
So the next step after extracting the 2Hz Noise is to find an average value of this signal and subtract it. An electronics engineer would call this “AC coupling.”
One final step for the best quality is to smooth the 2Hz signal. It’ll work well enough without this, but sometimes there are hints of horizontal streaks in the final supposedly clean image due to high-frequency image details and oddball glitches. A Savitzky-Golay smoother applied to the extracted 2Hz noise got rid of any of these odd glitches, making for a very clean output image.
Extra Pixels
When I said the image sensor was 1024×1024, I lied. It’s really a few more horizontally, 1032×1024. The eight extra are called “extended” pixels and are physically covered so they receive no light. These provide an objective measurement of the bias level, and as it turned out, the 2Hz noise.
Also, when reading out a row, it’s not 1024 times the charges are shifted and measured, and it’s not 1032 times. The readout process continues another eight cycles, even if there are no more CCD cell charges to shift and measure. These are “overclocked” pixels, giving more measurements of bias, random electronics noise and the 2Hz signal that don’t include dark current.
If an image has no dark sky, or is so peppered with cosmic rays or intricate rings that there’s not enough dark sky to make use of, then these extended and overclocked pixels can be used instead of row median values to recreate the 2Hz Noise signal. Mostly we prefered the dark sky method. When at least thirty dark sky pixels are available, a cleaner 2Hz Noise signal can be obtained.
Results
This compares a raw input image to the outputs of several different algorithms. On the left and right is a narrow strip cut from the raw 1024×1024 image. The tiny white dots are all cosmic rays. This image was made in shutter-disabled mode, like looking with your eyes closed. What we see is a bias level, fuzzy grainy pixel-to-pixel noise, cosmic rays passing through the image detector, and the obvious 2Hz noise as soft horizontal bands.
Two strips on the right half are results from a filter someone at JPL wrote. I think it made the problem worse. At the time, everyone was busy with various scientific and data processing tasks. No one had much time to fix the 2Hz Noise.
My earliest attempts to fix the noise using median, but before I tried pre-smoothing and some other refinements, is the third strip from the left, labelled “old dsw”. After discovering how effective pre-smoothing is, and making a few minor tweaks to thresholding and adding the Savitzky-Golay smoother, I produced the “new dec-11” output, where there’s barely any hint of the horizontal bars. Note that the cosmic rays and random patterns in the pixel-to-pixel noise are the same in this output as they are in all the strips.
The December 11th 2Hz Noise Removal Filter does a perfect job of removing those bars, and otherwise does not alter the image in any way. It has been incorporated into Cassini’s official image calibration software, CISSCAL, and I’ve rewritten it in Python, C++ and other languages for use in specialized image manipulation tools.

