Hot answers tagged

23 votes

When concatenating sine waves, how do I phase shift in order to prevent "pops" caused by sudden jumps in amplitude?

A simple solution is to implement the waveform in phase versus time instead of frequency versus time which can then facilitate phase continuous transitions. Frequency is the time derivative of phase, ...
user avatar
  • 37.7k
10 votes

Signal processing in Python vs C++ (band-pass filter)

Not really an answer but too long for a comment. Standard software development and debug techniques should solve this Don't use code on real data before it has passed all unit tests First write the ...
user avatar
  • 32.8k
8 votes
Accepted

SOS-matrices' order does not correspond to given parameter when designing bandpass with scipy.signal.butter

Your expectations are reasonable. However, the definition of order in the design routine is confusing. It's the same in Matlab/Octave. For lowpass or highpass ...
user avatar
  • 80.4k
7 votes
Accepted

Kalman Filter State Covariance Matrix for Non Constant Process Noise Matrix in PyKalman

For classic Kalman Filter, where $ {Q}_{k} = Q $ and $ {R}_{k} = R $, namely the process noise covariance and the measurement noise covariance (I'm using Wikipedia - Kalman Filter notations) the ...
user avatar
  • 41.4k
7 votes
Accepted

How Are MATLAB's `cpsd()` and SciPy's `csd()` Related?

Both scipy.signal.csd() and MATLAB's cpsd() use Welch's method. But their default parameters are different: Window: On MATLAB ...
user avatar
  • 41.4k
7 votes
Accepted

Can the deconvolution Wiener filter reduce noise without having a blurred image?

For Salt and Pepper noise on medical or real world images using the Wiener Filter isn't recommended. The Wiener filter basically takes advantage only on the knowledge from the spectrum of the data. ...
user avatar
  • 41.4k
6 votes

Python vs Matlab? Which one better for image processing?

I have spent the first 20 years of my career working extensively in MATLAB for signal processing applications. Six years ago I gravitated over to Python out of curiosity and it has since completely ...
user avatar
  • 37.7k
6 votes
Accepted

Which Programming Language Should Be Used for Deep Learning (Deep Neural Network [DNN])?

The language choice depends on many factors. For instance, are you after developing low level features of DNN or using existing building blocks? Most advanced and popular Deep Neural Networks (DNN) ...
user avatar
  • 41.4k
5 votes
Accepted

Reconstruction of a Signal from Sub Sampled Spectrum by Compressed Sensing

We're after the problem: $$\begin{aligned} \arg \min_{\boldsymbol{x}} \quad & {\left\| \boldsymbol{x} \right\|}_{1} \\ \text{subject to} \quad & \hat{F} \boldsymbol{x} = \boldsymbol{y} \end{...
user avatar
  • 41.4k
5 votes
Accepted

Understanding the Bilateral Filter (Image Filtering)

There are some good resources on our site: Understanding the Bilateral Filter - Neighbors and Sigma. How to Validate Bilateral Filter Implementation? What Is the Bilateral Filter Category: LPF, HPF, ...
user avatar
  • 41.4k
5 votes
Accepted

Filter Artifacts from Periodic Filtering

What you see is indeed by either using filtration on the frequency domain which uses periodic boundary condition or by using is explicitly. A better choice would be the ...
user avatar
  • 41.4k
4 votes

Dealing with the Cyclic Boundary Conditions of Frequency Domain Convolution in Order to Apply Linear Convolution

I created a MATLAB function which is basically conv2() applied in Frequency Domain: ...
user avatar
  • 41.4k
4 votes

Detecting bullet holes using Python with camera or sensors

I can't really comment on the machine vision part, other than any question that asks "How do I do <some signal processing task> in <some language>" is fairly naive. The way you ...
user avatar
  • 8,666
4 votes

When concatenating sine waves, how do I phase shift in order to prevent "pops" caused by sudden jumps in amplitude?

IMO the best way to implement this is a rotating phasor. Recall that $$ e^{jx} = \cos(x) + j \cdot \sin(x) $$ and $$ e^{j\omega(n+1) } = e^{j\omega n } e^{j\omega}$$ That means we can calculate the a ...
user avatar
  • 32.8k
4 votes
Accepted

What is the relationship among digital filter cutoff frequency, signal frequency and filter settling time?

With "Settling Time" we can consider the overall time delay of the filter, and the rise/fall time of a transient change going through the filter. The rise/fall time will inversely related to ...
user avatar
  • 37.7k
4 votes

How does SciPy's Welch function change the shape of the data?

Assuming that "6041" is a typo and it's actually "6401" that would be expected behavior. The result of welch() is a frequency domain vector the ...
user avatar
  • 32.8k
4 votes
Accepted

Unwanted periodicity in data

Some time-frequency analysis with the synchrosqueezed CWT, where I guess fs=10000 but this doesn't matter except for axis labels and physical interpretation. 1. ...
user avatar
3 votes

Python FIR Notch filter applied on both + and - frequency but only need + frequency

any real-valued system, such as a filter as yours, is symmetrical in spectrum. So, what you observe is inevitable. This is kind of a direct result from the fact that real signals are always ...
user avatar
3 votes

Python FIR Notch filter applied on both + and - frequency but only need + frequency

Here is one way to design a complex notch IIR filter Start with a real IIR filter, determine poles, zeros and gain Remove all the poles and zeros at negative frequencies, take the root of the gain ...
user avatar
  • 32.8k
3 votes
Accepted

FSK modulation with python

The phase of your output signal is not continuous, because you have implemented the phase as the output of one of two independent frequency oscillators both starting at time $0$, so their phases are ...
user avatar
  • 2,545
3 votes
Accepted

How to do high-resolution FFT on just the lower frequencies in a signal?

There is a fundamental limit to how much linear frequency resolution you are going to get for a given window size, at least using traditional linear techniques and making no assumptions about the ...
user avatar
  • 2,284
3 votes

My fft gives always gives the correct frequency or double the correct frequency

The 'beat' that you are looking for is a periodic signal but NOT a sine wave. So it can be represented as a sum of sine waves: the fundamental and multiples of it (harmonics). $$ x[t] = \sum_{n=0}^{P-...
user avatar
  • 32.8k
3 votes

Finding the mode of propagation of a progressive wave and the velocity of that mode

In your case the wave number $k = 2\pi f/c=2\pi$, $k_x$ and $k_y$ should satisfy $$ k^2 = k_x^2+k_y^2 $$ which means they are not always real. But the direction of propagation of wave is easy to ...
user avatar
  • 2,628
3 votes

Finding the mode of propagation of a progressive wave and the velocity of that mode

As already commented so far, for the linear wave equation to be satisfied in any number of dimensions the condition (here shown for three dimensions) $$ k^{2} = k_{x}^{2} + k_{y}^{2} + k_{z}^{2}$$ ...
user avatar
  • 742
3 votes
Accepted

Performing STFT after Butterworth Filter Seems Lower in Resolution

Color norm is the problem. By default, colors are mapped from im.min() to im.max(), so a single high-valued pixel will make the ...
user avatar
3 votes

Can the deconvolution Wiener filter reduce noise without having a blurred image?

Can a deconvolution Wiener filter reduce noise without blurring? Maybe. Maybe not. There is not one Wiener filter. Any concrete "Wiener filter" is a plain old filter that has been ...
user avatar
  • 8,666
3 votes

When concatenating sine waves, how do I phase shift in order to prevent "pops" caused by sudden jumps in amplitude?

Use phase from the start, and do not just multiply by time t - this is vital For each sine wave, use a variable to hold the current phase. Then for each time step, multiply ...
user avatar
  • 311
3 votes

What is the relationship among digital filter cutoff frequency, signal frequency and filter settling time?

(1) Filter settles slower if the ratio between signal frequency and filter cutoff frequency is smaller; (2) Filter settles slower if bandwidth of a band-pass filter is narrower: Correct in the sense ...
user avatar
  • 32.8k
2 votes
Accepted

Interpolation from discrete time fourier transform in python

If your signal is periodic you can simply interpolate by padding zeros in the frequency domain. This is equivalent to infinite circular sinc() interpolation and ...
user avatar
  • 32.8k
2 votes

Python vs Matlab? Which one better for image processing?

MATLAB's Image Processing toolbox is much richer than what you'd find on Python except OpenCV. OpenCV on Python doesn't feel natural yet still give you access to basically the largest library of image ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible