2

Let's say we have a measurement tool that, as a function of a probing position, returns a periodically changing value (in my case this is an atomic lattice in an electron microscope). Probing evenly in a line over a number of positions might return something like what we see on the top figure below.

Now, let's introduce a periodic scan distortion that follows a sinusoidal pattern. The actual probe position is now periodically a little off with each new position, according to some fixed strength, frequency and shift. This could look like what's seen in the second image. The plots I'm providing here for clarity have a shorter period than what I typically observe on real data. Real example below.

This situation could be generated by the following code (with image generation here), and represented in the lower plot below.

import numpy as np
import matplotlib.pyplot as plt

N = 600
probe_positions = np.arange(N)
def probe_function(probe_positions):
    return np.sin(2*np.pi*probe_positions / 150)**2

strength = 3
period = 50
shift = 5
disturbance = strength*np.sin((probe_positions - shift)*2*np.pi/period)
disturbed_probe_positions = probe_positions + disturbance

Images of (top) function with no distortion on probe position and (bottom) distortion present

Does there exist a way to transform the measured spectrum into the original spectrum, given some known strength, frequency and phase shift of the distortion? I think I am looking for some sort of sinusoidal transform function that interpolates the values based on their neighbours, according to given strength, frequency and shift.

To add some further details, the following simulated distorted electron microscope nanoparticle image (right) is an example of what we might observe on a system with heavy distortion. This sort of image is generated by scanning in a "flyback" fashion, where one scans a beam that generates a pixel intensity. It starts in the top left corner, scans across the row until the end, and then repeats from the start of the next row. What I am hoping to achieve, is to try various transforms (with some knowledge about likely frequencies) to remove the distortion on the image to make it like the left image.

Images of atomically-resolved nanoparticle (left) without and (right) with distortion

TomNorway
  • 2,584
  • 1
  • 19
  • 26
  • Does this answer your question? [How to remove frequency from signal](https://stackoverflow.com/questions/39799821/how-to-remove-frequency-from-signal) – Trenton McKinney Aug 28 '20 at 23:28
  • [How to filter noise with a low pass filter](https://medium.com/analytics-vidhya/how-to-filter-noise-with-a-low-pass-filter-python-885223e5e9b7) – Trenton McKinney Aug 28 '20 at 23:30
  • @TrentonMcKinney, I think that would be the correct choice to remove the noise from the `disturbed_probe_positions` but not from the actual measured data. But I'm not completely certain. I feel like there should be a way that doesn't involve chopping(setting to zero) the fourier transform, given that we know the frequency. – TomNorway Aug 29 '20 at 09:12
  • Two other ideas - identify adjacent nearby "rows" in your image and *spatially* align them. Another - if you have a strong prior for what your signal looks like (and it looks like you do), you could fit a model of your undistorted signal to your measurements: look up "template matching". Ping back if I'm not clear. – bogovicj Sep 03 '20 at 12:48

0 Answers0