Hot answers tagged

26 votes

How can I work on DSP using C/C++?

MATLAB is a desktop computing environment, that's designed to make it easy to do math in batches. And if you were to have access to the MATLAB source code, you'd find that as you dig down into it, ...
TimWescott's user avatar
  • 12.5k
20 votes
Accepted

Frequency shifting of a quadrature mixed signal

If you have a quadrature mixed signal, you have two outputs of the signal in 90 degree phase to each other. To complete a full complex frequency conversion (which would shift the frequency in one ...
Dan Boschen's user avatar
  • 50.1k
18 votes

How can I work on DSP using C/C++?

C/C++ is the standard language for real time and embedded signal processing. MATLAB is in most cases way too memory hungry and way too slow. There is a lot of signal processing happening in, for ...
Hilmar's user avatar
  • 44k
17 votes
Accepted

What is the difference between the PSD and the Power Spectrum?

The power spectrum is a general term that describes the distribution of power contained in a signal as a function of frequency. From this perspective, we can have a power spectrum that is defined over ...
hops's user avatar
  • 1,422
16 votes
Accepted

Which image filter can be applied to remove gridded pattern from corrupt jpegs?

You can use a standard inpainting algorithm. These algorithms replace marked pixels in an image with the pixel values that surround these marked pixels. The challenge here is to detect the grid (my ...
Maximilian Matthé's user avatar
14 votes

Why is it a bad idea to filter by zeroing out FFT bins?

This question has also confused me for a long time. @hotpaw2's explanation is good. You may be interested in the simple experiment using matlab. https://poweidsplearningpath.blogspot.com/2019/04/...
Po-wei Huang's user avatar
13 votes
Accepted

Use of "Audacity"for teaching undergraduate labs of digital signal processing for electrical engineering students?

That depends on a lot on your learning goals for the lessons and the lab. Audacity is primarily an audio editor designed for music recording and production. It has a lot of signal processing baked in, ...
Hilmar's user avatar
  • 44k
11 votes
Accepted

Python vs Matlab? Which one better for image processing?

[Comparison with cars at the end] For learning from scratch, I would not suggest a programming language alone, but instead the couple "teaching materials" (book, lecture notes) + "...
Laurent Duval's user avatar
11 votes

Applying DFT twice does not actually reverse an array. Instead, the first element stays in place while the rest of the array is reversed. Why?

The sequence is exactly what you should expect: $$x[-n]=x[N-n]\tag{1}$$ Clearly, for $n=0$ $x[n]$ and $x[-n]$ have the same value. It seems like you were expecting to see the sequence $x[N-1-n]$ ...
Matt L.'s user avatar
  • 89.5k
11 votes
Accepted

This is how my professor is finding the frequency response of an LTI system when given the impulse response. Is this wrong?

Your professor is right, and you're almost right too. The filter is clearly an FIR filter, but because its frequency response can be expressed as a geometric series, a recursive implementation is ...
Matt L.'s user avatar
  • 89.5k
10 votes
Accepted

How to get scipy remez to give matlab firpm answer?

The firpm and remez commands return symmetric linear phase filter solutions. In order to create a symmetric linear phase high pass filter, you must have an odd number of taps (Type 1 filter, see chart ...
Dan Boschen's user avatar
  • 50.1k
9 votes

How to compute dBFS?

All the standards define dBFS as an RMS measurement, relative to the RMS level of a full-scale sine wave, so the calculation is: ...
endolith's user avatar
  • 15.7k
9 votes
Accepted

MATLAB: $\tt fft$ and $\tt ifft$ scaling

Whether or not to scale the forward FFT by 1/N depends on which result you want for further analysis: energy (preserving Parseval's identity), or amplitude (measuring height or volts, etc.). If you ...
hotpaw2's user avatar
  • 35.3k
9 votes

Generating data with Gaussian distribution

Let $\Delta = [x_1, \dots, x_N]$ be your desired vector where $x_i$ are iid $\mathcal{N}(0,\sigma^2)$. Do you expect that $\mathrm{Pr} \left\lbrace ||\Delta||_2^2 < 0.5\right\rbrace = 0.9$ ? By ...
AlexTP's user avatar
  • 6,585
9 votes
Accepted

Correct way to add AWGN to a signal

Short answer 10*log(bw/fs) to take into account the oversampling operation because the awgn() function specifies the signal-to-...
AlexTP's user avatar
  • 6,585
9 votes
Accepted

FFT vs DFT Run Time Comparison (Complexity Analysis) in MATLAB

Abhinav Jain, Welcome to DSP Community. I build for you a proper testing of the run time comparison. Few tips about timing in MATLAB: Never time in a script. Always call a function to do the heavy ...
Royi's user avatar
  • 19.5k
9 votes
Accepted

Computing a convolution using FFT and more than minimum number of samples

Simply keep the first 1049 samples of the IFFT result and throw the rest away. You don't have to do a fftshift ...
ZR Han's user avatar
  • 3,218
9 votes
Accepted

Why the sum of filter coefficients of an FIR filter does not add to 1?

I'm assuming your FIR filters are nonrecursive tapped-delay line FIR filters. For such filters the sum of a filter's coefficients will equal the filter's gain at zero Hz (DC). This property results ...
Richard Lyons's user avatar
8 votes

MATLAB: $\tt fft$ and $\tt ifft$ scaling

The scaling convention used by Matlab is common in DSP. You could also use the unitary DFT where both the DFT and the IDFT are scaled by a factor of $1/\sqrt{N}$. You could also use the factor $1/N$ ...
Matt L.'s user avatar
  • 89.5k
8 votes

For 2D signals can it be said that the frequency response is the same as the Fourier transform?

Yes for 2D signals you can take a 2D fft, and if the 2D signal is represented in the time domain, then its fft is represented in the frequency domain. 2D FFT's have many other interesting ...
Dan Boschen's user avatar
  • 50.1k
8 votes
Accepted

Why is Scipy implementation of Hilbert() function different from Matlab implementation of the function?

It works fine for me: ...
endolith's user avatar
  • 15.7k
8 votes

Half power frequencies is -6dB or -3dB

The definition of the cut-off frequency is arbitrary. Different design methods use different definitions. If you define the cut-off at $-6\textrm{ dB}$, it means that the amplitude of a sinusoidal ...
Matt L.'s user avatar
  • 89.5k
7 votes
Accepted

Can you decimate / downsample a signal in frequency domain just like you can interpolate / upsample it?

Your interpolation operation is an upsampling operation with subsequent low-pass filtering. This translates to zero-padding in the frequency domain. Given your original signal $x[n]$, you upsample it ...
Maximilian Matthé's user avatar
7 votes
Accepted

Educational purpose - What is the correct way to simulate a multipath fading channel which has ISI

Lets say we want to transmit a sequence of discrete data $\left\lbrace x[n] \right\rbrace$. But because we are living in analog world, the sequence must be modulated. Call $T_s$ is symbol duration ...
AlexTP's user avatar
  • 6,585
7 votes
Accepted

MATLAB: Adding Noise with Regard to Signal to Noise Ratio (SNR) or EbNo?

These stuffs $E_s/N_0, E_b/N_0 \textrm{ and SNR}$ are convertible. \begin{align} E_s/N_0 &= E_b/N_0 + 10\log_{10}(k) \\ E_s/N_0 &= 10\log_{10}(T_{sym}/T_{samp}) + \mathrm{SNR} \end{align} ...
AlexTP's user avatar
  • 6,585
7 votes
Accepted

Sequential Form of the Least Squares Estimator for Linear Least Squares Model

Slope from all samples obtained To summarize the question's problem, you want to calculate the slope based on all samples obtained thus far, and as new samples are obtained, update the slope without ...
Olli Niemitalo's user avatar
7 votes

Covariance matrix for sine wave extraction

This is an unsolvable problem. When you add two sinusoidal tones of the same frequency you get a sinusoidal of the same frequency (even the possibility of one with zero amplitude). Adding five just ...
Cedron Dawg's user avatar
  • 7,550
7 votes
Accepted

Deconvolution of Synthetic 1D Signals - How To?

You cant't recover the original signal through deconvolution. A Gaussian kernel is in essence a lowpass filter, i.e. it will remove information at higher frequencies from the signal. Once it's gone, ...
Hilmar's user avatar
  • 44k
7 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 ...
Dan Boschen's user avatar
  • 50.1k
7 votes

Applying DFT twice does not actually reverse an array. Instead, the first element stays in place while the rest of the array is reversed. Why?

Yes reversed (!) but not in the programming sense ! The sequence $N \cdot x[-n]$ which results after applying DFT twice to the N-point sequence $x[n]$ is a time-reversed (and amplitude scaled by $N$) ...
Fat32's user avatar
  • 28.1k

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