|LongHairedHacker 5795a75251 Reset max level after first sync for better dynamic range||1 year ago|
|src||1 year ago|
|.gitignore||2 years ago|
|Cargo.lock||1 year ago|
|Cargo.toml||1 year ago|
|example.png||1 year ago|
|flow.png||1 year ago|
|noaa19_short.png||1 year ago|
|noaa19_short.wav||1 year ago|
|readme.md||1 year ago|
A simple tool for decoding the Automatic Picture Transmissions broadcasted by the NOAA Weather satellites to PNG files.
Existing tools like WxToImg or atp-dect are either not open source or no longer maintained and unnecessarily complex. apt-decoder provides a lightweight, simple to use and easy to understand solution.
cargo build --release
apt-decoderbinary is in
apt-decoder <your WAV file> <destination PNG file>You can also run the example contained in this repo:
apt-decoder noaa19_short.wav noaa19_short.png
The AM-data from the WAV files is decoded using a simple square law demodulator. Squaring the input signals yields the square of the original signal and sideband with the twice the carrier frequency.
Computing the square root of the signal does not change its frequency spectrum, but restores the amplitude of the original signal part. The square root function is usually frowned upon in literature about signal processing, as it is rather complex to implement on traditional DSP architectures. In contrast to that ALUs in modern x86 or ARM CPUs can computer the square root efficiently, so there is no harm in taking a shortcut here.
A lowpass then gets rid of the higher sideband, leaving only the demodulated original signal.
Afterwards the signal is sampled down to 4160kHz, as original signal contains 4160 pixels per line. For additional efficiency the upsampler inserts zeros into the input signal instead of actually interpolating the missing samples. This works because the downsampler following afterwards works by computing the average over a number of samples and therefore acts as a low pass.
Finally a line syncer module looks for the sync A and sync B patterns to add line sync information to the signal, which can then be written out into a PNG file.
Feel free to write emails to sebastian(a)sebastians-site.de