New answers tagged

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
  • 291
2 votes

FFT of a gaussian signal in Python

There are two issues: The time axis is not long enough to capture a sufficient length of the Gaussian. The FFT is not properly scaled. For the first item mentioned regarding the time axis, the ...
user avatar
  • 36.1k
0 votes

Why is this Python implementation of trigonometric interpolation not working properly?

I strongly suggest using the Dirichlet interpolation. The basic idea is the interpolation via the Fourier transform: $$f(x)=\sum_k \hat{f}(k)e^{ikx}$$ Here is an implementation for arbitrary chosen ...
user avatar
1 vote

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

One solution I see is to concatenate the two, different amplitude sines at their zero crossings, making sure they have the same phase (e.g. if one goes up, the other has to go up, too). This way, the ...
user avatar
22 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
  • 36.1k
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
  • 30.6k
0 votes

Simulation of Lock-In Amplification in Python makes no sense

Ok, the problems seems to be that I need to first low-pass filter both the d and q components separately before applying the norm operation, here is the corrected code: ...
user avatar
0 votes

Order analysis on sample vibration data to detect unbalance in python

I think you are doing basically right, you can selectively add two more steps: (1) Check max order for a new sampling rate in order domain, make sure you avoid aliasing. (2) Add some flexibility to up-...
user avatar
  • 11
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,071
0 votes

Are there any order analysis functions in Python?

I am not sure if you can find an implementation to those functions (you might do if you will look long enough). Main point, each of those functions might be implemented in several lines so there is no ...
user avatar
6 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
  • 39.1k
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
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
  • 36.1k
1 vote
Accepted

Butterworth filter cutoff attenuation is not exactly 0.707(-3dB)

Filter needs time to settle down. This settling process altered the beginning of time domain data and created the small difference. I took the second half of time domain filtered data and got a ratio ...
user avatar
  • 11
1 vote

Butterworth filter cutoff attenuation is not exactly 0.707(-3dB)

What you see there are margin issues. By not applying a window function to your signal before the FFT, you effectively convolute your spectrum with an $\text{si}$ function, which leads to artifacts ...
user avatar
  • 1,619
1 vote

How to achieve a periodized Mexican hat wavelet with period L by using Python?

This is quite straight forward, if you use Python's numpy library. It is capable of array operations and thus, this task is just a few lines. ...
user avatar
  • 1,619
1 vote
Accepted

A scaling difference between MATLAB's pwelch and Python's SciPy welch

MATLAB's function pwelch scales the PSD under the assumption that the DFT is executed across the range of $0:2 \pi$ in the event the sample frequency is not passed to the function. Thus, you have ...
user avatar
  • 26

Top 50 recent answers are included