Skip to main content
25 votes

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

Phase continuous transitions can be accomplished by implementing the waveform in phase versus time instead of frequency versus time. Frequency is the time derivative of phase, so instead of stepping ...
Dan Boschen's user avatar
  • 52.8k
17 votes
Accepted

What is the audible level for digital audio dB units?

The confusion arises from the fact that the decibel (dB) is a relative unit of measurement, not an absolute one. The dB scale in audio can reference different things depending on the context, which ...
Ahsan Yousaf's user avatar
  • 1,573
12 votes
Accepted

Amplitude modulation vs sampling rate?

The OP's opening statement is incorrect: $f_s > f_{max}/2$ prevents frequency aliasing for a bandlimited signal, but not amplitude aliasing $f_s > 2 f_{max}$ prevents aliasing. It's as simple ...
Dan Boschen's user avatar
  • 52.8k
9 votes
Accepted

Understanding FFTs for simple Circular Function (sin/cos)

Creating the Frequency Vector The arrangement of the output of fft() depends on whether you use an odd or even number of points for your fft. I think this post nicely summarises how the frequencies ...
teeeeee's user avatar
  • 681
8 votes

What is the audible level for digital audio dB units?

dB is a logarithmic metric against a well defined reference. There are many different types of "dB" depending on the nature of the signal. For example voltage measurements can be in dBv, dBu,...
Hilmar's user avatar
  • 46.2k
7 votes
Accepted

What is the (approximate) function for amplitude of a plucked string over time? Does it differ between string types?

An exponentially decaying envelope $a\exp(-b x)$ is a good choice, and is used for example in vintage Yamaha FM synthesizers. It has the favorable property that over any constant length time interval, ...
Olli Niemitalo's user avatar
7 votes

What is the audible level for digital audio dB units?

There's one broad standard that is only strictly followed in certain conditions. The cinema standard is a 500-2000 Hz band-limited pink noise signal with digital RMS amplitude of -20 dB full scale ...
user71659's user avatar
  • 171
6 votes

Difference between single sided and double sided amplitude spectrum

For real-valued signals, the frequency spectrum is conjugate symmetric; i.e., $$X(f) = X(-f)^*$$ This translates into an even magnitude spectrum $$|X(f)| = |X(-f)|$$ and an odd phase spectrum. Because ...
Fat32's user avatar
  • 28.3k
6 votes
Accepted

Can FFT tells us existance of same frequencies with different phases?

I am thinking of two numbers. They add to the number 15. Tell me what the two numbers are.
robert bristow-johnson's user avatar
6 votes

What causes the mismatch between a calculated sine wave and a measured sine wave?

Sorry, can't reproduce. I did the same thing with the dither turned off and found a perfect match between the generated sine wave and the calculated values. Even with a dither turned on things were ...
Hilmar's user avatar
  • 46.2k
5 votes

Equal power crossfade

This is a continuation of the (music-dsp) thread started by Element Green titled: "Algorithms for finding seamless loops in audio" As far as I know, it is not published anywhere, although I ...
robert bristow-johnson's user avatar
5 votes
Accepted

Quadrature modulation for FM and AM

Both amplitude and frequency modulated radio signals nowadays use quadrature modulation and demodulation as a mean to transfer and receive radio signals. This question is ill-defined – a signal ...
Marcus Müller's user avatar
4 votes

Do DCT results contain phase spectrum?

A DCT is equivalent to a DFT of real data that is doubled and mirrored, thus rendering it symmetric. The DFT of any symmetric real signal has a phase of zero (its all cosines, no antisymmetric sine ...
hotpaw2's user avatar
  • 35.5k
4 votes

Do DCT results contain phase spectrum?

Not really, as the transform is real. However, one could interpret the sign as a poor man's phase, being "quantized" or restricted to values $0$ or $\pi$. In other words, $1 = 1.e^{0.\imath}$ and $-1 =...
Laurent Duval's user avatar
4 votes

Amplitude reduction of Simple Moving Average on sinusoid

Below is the analytic result for both the actual max value of $0.901243$ and the maximum value found by the OP of $0.898464$ The reason you are not getting the predicted maximum is your samples of ...
Dan Boschen's user avatar
  • 52.8k
4 votes

Understanding FFTs for simple Circular Function (sin/cos)

Know that each bin in the FFT is the value for the exponential $e^{j\omega t}$, not sine or cosine. So for the OP's case $5sin(2\pi 3 x-2)$ in terms of exponentials (see Euler's identity) this is: $...
Dan Boschen's user avatar
  • 52.8k
4 votes

Amplitude modulation vs sampling rate?

The claim is wrong. Sampling of a pure sinusodial whose frequency is below but arbitrarily close to the Nyquist frequency (half the sampling frequency) is a perfectly valid operation, as long as you ...
Fat32's user avatar
  • 28.3k
4 votes

Relationship between amplitude and sampling rate

In order to resample without aliasing, the resampling process needs to apply an anti aliasing filter at the new Nyquist Frequency (or thereabouts). So chances are, your resampling process applied a ...
Hilmar's user avatar
  • 46.2k
4 votes

Is digital necessarily discrete in both amplitude and time?

It's a matter of definition. Usually one defines digital to be discrete in both, discrete time to be (possibly) amplitude continuous and quantized to be (possibly) time continuous.
Uroc327's user avatar
  • 231
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 ...
Hilmar's user avatar
  • 46.2k
4 votes

Why MATLAB's abs(fft(X)) returns maximum amplitude first harmonic's while in signal maximum is second's?

Spectral leakage. In order for FFT of a sine wave to be a single line, the sine wave must have an integer multiple of periods in the FFT window. Try the following ...
Hilmar's user avatar
  • 46.2k
3 votes

Closest two frequencies that can be resolved

There is no issue of frequency resolution in a typical modulation and demodulation scheme. (unless you want to implement some frequency/signal detectors) Putting two message signals in adjacent ...
Fat32's user avatar
  • 28.3k
3 votes
Accepted

First-Order Hold Filter Gain

That's correct, $0.4053$ is the approximate magnitude of the frequency response of linear interpolation at the Nyquist frequency. With the definition: $$\operatorname{sinc}(x) = \frac{\sin(\pi x)}{\...
Olli Niemitalo's user avatar
3 votes
Accepted

Amplitude loss during resampling with IIR

Try adding a gain of 16 before your low pass filter, or equivalently using a low pass filter with a passband gain of 16 instead of 1.
awalls's user avatar
  • 46
3 votes

A clarinet has no even harmonics. What would produce no odd harmonics?

The clarinet has no even numbered harmonics up from its lowest pitch because of its shape. It is open at one end (the bell) and effectively closed at the other (the mouthpiece). This causes the ...
Karl Kaiser's user avatar
3 votes
Accepted

Help me understand how Pulse-Amplitude Modulation (PAM) works

If you define pulse amplitude modulation (PAM) as a method where a train of pulses is generated with the information coded by the amplitude of these pulses then both methods comply with that ...
Matt L.'s user avatar
  • 90.6k
3 votes
Accepted

Lock-in amplifier

The answer to your questions is yes, at least for the ideal situation. My simulation is presented below, with the following assumptions: 1) the small signal is a sinewave at 12.5 Hz, with 10 mV peak ...
Ed V's user avatar
  • 795
3 votes

Equal power crossfade

As people in the other answer have been asking for a code snippet (and as I don't have enough reputation to comment on answers), here's the other answer implemented in C# (which should be easy enough ...
Lachlan Sleight's user avatar
3 votes
Accepted

Why is there an amplitude difference in Matlab and Python?

I suspect python is reading signed 16 bit int values from the wav file whereas Matlab is rescaling it to floating point numbers between [-1,1]. Try the "native" option with audioread in Matlab. https:/...
Atul Ingle's user avatar
  • 4,134

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