# Tag: signal-processing

## Unable to distinguish four cosines from a FFT

I have four cosines with frequencies 400e-3, 500e-3, 600e-3 and 700e-3 and I am trying to do the FFT of them but under the time I need, I cannot distinguish the four. Is there a way to distinguish the peaks without changing the tmax time of 1.76 and the frequencies? Here are the results: Answer The solution was to increase

## Is there any way to detect edge in this situation?

I try to detect edge using python. There are hundreds of algorithms for edge detection, however, the image is very obscure and unclear. The most serious problem is one edge is located at the local maximum value, but the other edge is located slightly shifted from local maximum value. Through the detailed examination, I found the other edge is located

## Interpolating measured sine wave using python

I have 2 sampled sine waves obtained as a measurement from a DSO. The sampling rate of the DSO is 160 GSa/s and my signal is 60 GHz. I need to find the phase difference between the two sine waves. …

## Progressively filter/smooth a signal in python (to straight line on the left to no filtering on the right)

A picture is worth a thousand words (sorry for the shoddy work): If the solution is preserving the value and the slope at both ends it is better. If, in addition, the position and sharpness of the …

## Butterworth filters look very strange as increasing order

I’m trying to design a simple Butterworth bandpass filter in SciPy, and I’m running into some strange results. This is giving strange results, as can be seen from the image below (Butterworth filters from order 1-10). I thought the filter was supposed to become increasingly rectangular as the order increased? Does anyone know how to […]

## Get In Focus Pixels of an Image

How to detect which pixels of an image are in focus compared to the blurry ones. Something like the ‘Focus Peaking’ feature lots of cameras have? The idea is to color the pixels that are in focus so that it assists the user while clicking a picture. Looking for an implementation through Python. AdvertisementAnswer You […]

## Scipy.signal.spectrogram output lengths

I am trying to analyze the frequencies of a song at certain points of time held inside an array. I am using the scipy.signal.spectrogram function to generate those frequencies. the length of the song is 2:44, or 164 seconds, and the sampling rate of the scipy.wavfile read is 44100. When I use spectrogram: The length of f is really small,

## How to implement band-pass Butterworth filter with Scipy.signal.butter

UPDATE: I found a Scipy Recipe based in this question! So, for anyone interested, go straight to: Contents » Signal processing » Butterworth Bandpass I’m having a hard time to achieve what seemed initially a simple task of implementing a Butterworth band-pass filter for 1-D numpy array (time-series). The parameters I have to include are the sample_rate, cutoff frequencies IN