9
$\begingroup$

From my old studies in signals I can remember that "a signal limited in frequency domain is unlimited in time domain" and viceversa (a signal limited in time domain is unlimited in frequency domain).

So, if I take a window over a sinusoidal signal: taking a limited frame of a infinite sinusoidal signal

The result is that we change the "pure frequency" domain to a domain with other frequencies: enter image description here

Well, how do "those extra frequencies" sound? So in practice, the limited signal will be some set of frequencies centered around the main frequency. I want to know how does that sound when removing the frequencies nearest to the main frequency but leaving all others.


I'm asking for (approximate) sound of:

enter image description here

You are allowed to shift those frequencies and to normalize the amplitude in order to bring them into an "audible range".

EDIT: I'm not sampling a sinus wave in a limited time, but sampling it in a long time with a limited signal.. in example:

enter image description here

If accidentally this question helps to find a way to syntethize some kind of noise (highly doubt, but), it will be already covered by stackexchange contents license.

$\endgroup$
  • $\begingroup$ If the signal is 100% sinusoidal, won't it will always appear as a delta function in the frequency domain regardless of the sampling time frame? $\endgroup$ – Secret Aug 8 '16 at 10:45
  • 7
    $\begingroup$ While the question itself is interesting enough, what you're asking for is certainly not the 'sound of silence'. For the latter, put on a good pair of noise-cancelling headphones and listen to this. (And of course this will also do if you get bored.) In any case, $-1$ for the misleading and quasi-clickbait title. $\endgroup$ – Emilio Pisanty Aug 8 '16 at 12:00
  • 1
    $\begingroup$ Have you looked at windowing functions? That is what you're doing right now. There's lots of windowing functions to manage the particular shapes of these "sounds." Are you only interested in the special case of a rectangular window with a single frequency inside? $\endgroup$ – Cort Ammon Aug 8 '16 at 14:23
  • 1
    $\begingroup$ I thought this was about the song by Simon & Garfunkel.. $\endgroup$ – Zenadix Aug 8 '16 at 14:58
  • 1
    $\begingroup$ You should also make it clear, in the question, whether you want to remove a delta-like slit from the Fourier transform, or just the (finitely sized) main lobe. $\endgroup$ – Emilio Pisanty Aug 9 '16 at 11:51
14
$\begingroup$

Fourier transform is a linear operation. This means that the infinite sinusoidal signal can be written as the sum of the sinus in the window plus the sinus outside the window. If $f(t)$ is your window function this means $$ \underbrace{\sin(t)}_{g_0(t)} = \underbrace{\sin(t) f(t)}_{g_+(t)} + \underbrace{(1-f(t)) \sin(t)}_{g_-(t)} $$ or in the fourier domain $$ g_0(\omega)= g_+(\omega) + g_-(\omega) $$ What you are asking for is in frequency domain $g_+(\omega)-g_0(\omega)$, which is in the time domain just $$ g_+(t)-g_0(t) = (f(t)-1)\sin(t) = -g_-(t) $$ So the "silence" sounds like a simple sine with a pause. The spectra also look somewhat different than what you have drawn. The finite sinus has a finite power spectrum and no delta peak. The "silence" contains the delta peak. enter image description here

The other possible way to understand your questions is that we look at the fourier transform of the windowed sinus and apply a filter in the frequency domain to cut out the main finite peak. The resulting spectrum would look like this.enter image description here Here I took a broader window function than in the first figure. The signal in the time domain then looks like thisenter image description here and sounds like this.

$\endgroup$
  • $\begingroup$ you answered indirectly, what I was asking was for the sound of the power spectrum minus the delta (however since we cannot do that for real, we remove a close approximation of the delta). So basically the answer is the last picture but after having removed the central part of the graph. So in reality the spectrum of my signal is very far from the delta. Are you aware of any tool that can synthesize the sound from the power spectrum graph so I can hear it? $\endgroup$ – GameDeveloper Aug 8 '16 at 11:36
  • 1
    $\begingroup$ @DarioOO The "silence" is given by $g_-$ and the windowed sinus is given by $g_+$ $\endgroup$ – Jannick Aug 8 '16 at 11:39
  • $\begingroup$ No it's not. He's asking for the Fourier Transform of $g_-$ with the peak subtracted, which should be the same as the Fourier Transform of $g_+$ with the area around the delta function subtracted, and this is not given in your answer. Furthermore, your plot doesn't look much like the right answer. $\endgroup$ – Peter Shor Aug 8 '16 at 11:46
  • 1
    $\begingroup$ The Fourier transform of the silence contains an infinite peak. The Fourier transform of the sound contains a very sharp, finite, peak. I'm assuming the OP wants to know what it sounds like with the actual finite peak removed. If you don't remove the finite peak, the sound is exactly the same. $\endgroup$ – Peter Shor Aug 8 '16 at 12:05
  • 1
    $\begingroup$ Okay ... looking again, maybe I'm wrong about your picture being completely irrelevant. That looks like the Fourier transform of a very, very, short sine wave (maybe 1 or 2 periods at most). If you took the Fourier transform of a longer sine wave, you would see a much, much sharper peak and many more lobes at either side. $\endgroup$ – Peter Shor Aug 8 '16 at 12:18
12
$\begingroup$

OK, so you start off with a monochromatic sinusoidal function at frequency $\omega_0$ and period $T=2\pi/\omega_0$, $$f(t)=A\sin(\omega_0t)$$ whose Fourier transform is a pair of delta functions: $$ \tilde f(\omega) =\mathcal F[f](\omega) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty f(t)e^{i\omega t}\mathrm dt = \frac{A}{2i}\left(\delta(\omega+\omega_0)-\delta(\omega-\omega_0)\right). $$

After this, you cut off a finite-size part of the sinusoid, down to $$g(t)=A\sin(\omega_0t)\chi_{[0,\tau]}(t),$$ using the characteristic function which is $1$ between $0$ and $\tau$, and zero elsewhere. As you note, the Fourier transform of this is no longer a pair of delta functions, because if the signal is limited to a finite timespan it can no longer be monochromatic.

However, your impression of how the added spectrum actually looks isn't particularly accurate (and in fact it's pretty awful). For the boxcar-times-sine function at hand, luckily, the Fourier transform is rather easy to calculate: \begin{align} \tilde g(\omega) & = \mathcal F[g](\omega) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty g(t)e^{i\omega t}\mathrm dt = \frac{A}{\sqrt{2\pi}}\int_{0}^\tau \sin(\omega_0t)e^{i\omega t}\mathrm dt \\ & = \frac {A}{i\sqrt{2\pi}}\left[ e^{i(\omega+\omega_0)\tau/2}\frac{\sin((\omega+\omega_0)\tau/2)}{\omega+\omega_0} - e^{i(\omega-\omega_0)\tau/2}\frac{\sin((\omega-\omega_0)\tau/2)}{\omega-\omega_0} \right], \end{align} i.e. a sinc function centered around $\omega_0$ and its symmetry-required conjugate at negative frequency.

The sinc function is a relatively sharp peak followed by a bunch of oscillations, and the width of the first peak is exactly $4\pi/\tau$, with each subsequent lobe of width $2\pi/\tau$. As the signal length $\tau$ gets longer and longer, the sinc peaks get taller and narrower, limiting to a delta function as they need to do. However, this signal is very regular and orderly, rather distinct from the noisy lump you drew.

Luckily, the fact that the lobes in the spectrum are neatly laid out mostly enables us to narrow down what you're asking for, which is (unless I'm mistaken) the sinc spectrum above with its central lobe flattened out, i.e. a function with the spectrum \begin{align} \tilde g_-(\omega) & = \tilde g(\omega) \times (1-\chi_{[\omega_0-2\pi/\tau,\omega_0+2\pi/\tau]}(|\omega|)). \end{align}

If you then want the time-domain version of this function, you simply need to Fourier transform this: you want $$ g_-(t) = \mathcal F^{-1}[\tilde g_-](t) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \tilde g_-(\omega) e^{-i\omega t}\mathrm d\omega. $$ Of course, this is rather more easily said than done, but in the end all you have is a bunch of sines and cosines, so it has to be possible in closed form (though it may involve the sine integral function, $\mathrm{Si}(x) = \int_0^x \frac{\sin(\xi)}{\xi}\mathrm d\xi$).

At this point it's worth remarking that the central lobe carries most of the energy for the function, with $$ \frac{ \int_{0}^\infty\sin(\xi)/\xi \: \mathrm d\xi }{ \int_{\pi}^\infty\sin(\xi)/\xi \: \mathrm d\xi } = 1-\frac{2}{\pi}\mathrm{Si}(2\pi) \approx 9.7\% $$ of the energy on the sidelobes.

Having said that, there is in fact an easier way to get the time-domain signal $g_-(t)$, and it relies on the convolution theorem: since the Fourier transform of $g_-(t)$ is a product of two functions, the back Fourier transform will be the convolution of the time-domain transforms of the two factors: $$ g_-(t) = (g * \mathcal F^{-1}[1-\chi_{[\omega_0-2\pi/\tau,\omega_0+2\pi/\tau]}-\chi_{[-\omega_0-2\pi/\tau,-\omega_0+2\pi/\tau]}])(t). $$ Here the second factor is all boxcars, so it has a direct expression \begin{align} \mathcal F^{-1}[1- & \chi_{[\omega_0-2\pi/\tau,\omega_0+2\pi/\tau]}-\chi_{[-\omega_0-2\pi/\tau,-\omega_0+2\pi/\tau]}](t) \\ & = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty [1-\chi_{[\omega_0-2\pi/\tau,\omega_0+2\pi/\tau]}(\omega)-\chi_{[-\omega_0-2\pi/\tau,-\omega_0+2\pi/\tau]}(\omega)] e^{-i\omega t} \mathrm d\omega \\ & = \frac{1}{\sqrt{2\pi}}\delta(t) -\frac{2}{t}\sin(2\pi t/\tau)e^{-i\omega_0 t} -\frac{2}{t}\sin(2\pi t/\tau)e^{+i\omega_0 t} \\ & = \frac{1}{\sqrt{2\pi}}\delta(t) -4\cos(\omega_0 t)\frac{\sin(2\pi t/\tau)}{t} \end{align}

OK, so that's one of the ingredients. How does the convolution actually look? The convolution with the delta is obviously just the identity transformation, so it's probably better to just focus on the signal from the single central lobe, $$ \tilde g_+(\omega) = \tilde g(\omega) \times \chi_{[\omega_0-2\pi/\tau,\omega_0+2\pi/\tau]}(|\omega|), $$ and then we can reconstruct $g_-(t) = g(t)-g_+(t)$ afterwards. As it happens, the convolution needs to be normalized a bit weirdly (since the normalization can only work cleanly for the inverse transform or the convolution theorem, but not for both), so in this case we have \begin{align} g_+(t) & = (g * \mathcal F^{-1}[\chi_{[\omega_0-2\pi/\tau,\omega_0+2\pi/\tau]}+\chi_{[-\omega_0-2\pi/\tau,-\omega_0+2\pi/\tau]}])(t) \\ & = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty g(t') \times \mathcal F^{-1}[\chi_{[\omega_0-2\pi/\tau,\omega_0+2\pi/\tau]}+\chi_{[-\omega_0-2\pi/\tau,-\omega_0+2\pi/\tau]}] (t-t') \mathrm d t' \\ & = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty g(t') \times 4\cos(\omega_0 (t-t'))\frac{\sin\left(\frac{2\pi}{\tau}(t-t')\right)}{t-t'} \mathrm d t' \\ & = \frac{A}{\sqrt{2\pi}} \int_{0}^\tau \sin(\omega_0 t') \times 4\cos(\omega_0 (t-t'))\frac{\sin\left(\frac{2\pi}{\tau}(t-t')\right)}{t-t'} \mathrm d t' \\ & = \frac{4A}{\sqrt{2\pi}} \int_{t-\tau}^{t} \sin(\omega_0 (t-t'')) \cos(\omega_0 t'')\frac{\sin\left(\frac{2\pi}{\tau}t''\right)}{t''} \mathrm d t''. \end{align} Past that point, calculating $g_+(t)$ is just an exercise in putting together all the trigonometric functions of $t''$ and then encasing any relevant integrals into sine and cosine integrals, $\mathrm{Si}(x)$ and $\mathrm{Ci}(x)$. This needs to be done separately for the cases $\omega_0\tau>2\pi$ and $\omega_0\tau<2\pi$, ant it can be a little bit tricky to handle because $\mathrm{Ci}$ turns out to have a branch cut on the negative real axis which butts its ugly head in. Generally,though, you're interested in a pulse that's more than one half-cycle, so you can safely take $\omega_0\tau>2\pi$.

\begin{align} \DeclareMathOperator{Si}{Si} \DeclareMathOperator{Ci}{Ci} g_+(t) & = \frac{A}{\sqrt{2\pi}}\mathrm{Re}\left[ \cos(\omega_0 t)\left( \Ci\left(\left(\frac{2\pi}{\tau}-2\omega_0\right)(t-\tau)\right) -\Ci\left(\left(\frac{2\pi}{\tau}+2\omega_0\right)(t-\tau)\right) \right. \right. \\ & \qquad \qquad \qquad \qquad \qquad \left. \left. +\Ci\left(\left(\frac{2\pi}{\tau}+2\omega_0\right)t\right) -\Ci\left(\left(\frac{2\pi}{\tau}-2\omega_0\right)t\right) \right) \right. \\ & \qquad \qquad \quad \left. +\sin(\omega_0 t)\left( 2\Si\left(\frac{2\pi}{\tau}t\right) -2\Si\left(\frac{2\pi}{\tau}(t-\tau)\right) \right. \right. \\ & \qquad \qquad \qquad \qquad \qquad \left. \left. +\Si\left(\left(\frac{2\pi}{\tau}+2\omega_0\right)t\right) +\Si\left(\left(\frac{2\pi}{\tau}-2\omega_0\right)t\right) \right. \right. \\ & \qquad \qquad \qquad \qquad \qquad \left. \left. -\Si\left(\left(\frac{2\pi}{\tau}+2\omega_0\right)\right) -\Si\left(\left(\frac{2\pi}{\tau}-2\omega_0\right)(t-\tau)\right) \right) \right] \end{align}

if I haven't mucked up the algebra.

This is a bit of a tricky expression because, while the sine integral $\Si(x) = \int_0^x \frac{\sin(\xi)}{\xi}\mathrm d\xi$ is regular at $x=0$, the cosine integral $$ \Ci(x) = -\int_x^\infty \frac{\cos(\xi)}{\xi}\mathrm d\xi \sim \ln(x)\quad\text{as }x\to 0 $$ is singular at the origin. However, since our initial integrand had a regular factor of $\sin(2\pi t''/\tau)/t''$ then the final integral also needs to be regular, so each pair of $\Ci$'s must have a vanishing singular part. Thus, for example, \begin{align} \Ci\left(\left(\frac{2\pi}{\tau}+2\omega_0\right)t\right) -\Ci\left(\left(\frac{2\pi}{\tau}-2\omega_0\right)t\right) &\sim \ln\left(\left(\frac{2\pi}{\tau}+2\omega_0\right)t\right) \\ & \quad -\ln\left(\left(\frac{2\pi}{\tau}-2\omega_0\right)t\right) \\ & = \ln\left(\frac{2\pi+2\omega_0\tau}{{2\pi}-2\omega_0\tau}\right), \end{align} and so on. The logarithm then gives off an imaginary constant that gets ignored by taking the real part.

The analytical expressions are kind of ugly but they exist and numerically they're not particularly problematic, so you can just plot them and that's it. If you do this, you get

for the main lobe, and

for the sidelobes.


Thus far for the interesting case. You might also say, of course, that even the main lobe is already "extraneous" frequencies that were not in the original delta peak, and that really you want to investigate the sinc transform $\tilde g(\omega)$ by removing a delta-function part around $\pm\omega_0$, as $$ \tilde h_-(\omega) = \tilde g(\omega) -\tilde f(\omega) $$ \begin{align} \tilde h_-(\omega) &= \tilde g(\omega) -\tilde f(\omega) \\ & = \frac {A}{i\sqrt{2\pi}}\left[ e^{i(\omega+\omega_0)\tau/2}\frac{\sin((\omega+\omega_0)\tau/2)}{\omega+\omega_0} - e^{i(\omega-\omega_0)\tau/2}\frac{\sin((\omega-\omega_0)\tau/2)}{\omega-\omega_0} \right] \\ & \qquad \quad - \frac{A}{2i}\left(\delta(\omega+\omega_0)-\delta(\omega-\omega_0)\right) , \end{align} so you're looking for something like this:

This then leads to why I said only the previous case was interesting, because the Fourier transform is linear and this therefore means that $$ h_-(t)=g(t)-f(t) = A\sin(\omega_0t)\chi_{(-\infty,0]\cup[\tau,\infty)}(t) $$ and what you thought were "extraneous" signals actually look like this:

Of course, they simply build up to an interrupted sinusoidal function, which exactly cancels out the monochromatic $f(t)=A\sin(\omega_0 t)$ on the places where $g(t)$ needs to be zero. So, not much going on here.

$\endgroup$
3
$\begingroup$

This is treated in numerous places on the web. For example, you can find it in here.

The formula for the Fourier transform of a cut-off sine wave is $$f(\omega) = \frac{2a}{\omega-\omega_0} sin \frac{(\omega-\omega_0)\,\tau}{2}, $$ where $\omega$ is the frequency of the original sine wave and $\tau$ is the widgth of the window.

It basically has a sharp central peak, and the tails are a sine wave decaying inversely with distance from the peak.

So when you remove the central peak, you get a sine wave in the frequency domain that decays with inverse distance from the (removed) peak. I really don't know what this sounds like.

$\endgroup$
  • $\begingroup$ Sorry, Peter, but wouldn't this be better off as a comment? (not my downvote, btw.) $\endgroup$ – Emilio Pisanty Aug 8 '16 at 11:53
  • $\begingroup$ @Emilio: I wasn't finished editing my answer yet. $\endgroup$ – Peter Shor Aug 8 '16 at 12:13
  • $\begingroup$ I guess the FGITW gets everyone in the end ;-). That said, if you remove the central peak from a sinc function, you're essentially multiplying it by $(1-\chi_{[0,\tau]})$, and the time domain form of that should be the convolution between the original boxcar-times-sine and the Fourier transform of the filter $(1-\chi_{[0,\tau]})$, which is itself a delta function minus a sinc function, so it should be doable analytically. $\endgroup$ – Emilio Pisanty Aug 8 '16 at 12:37
  • $\begingroup$ (Hah, sorry. I mean a $1-\chi$ function on the relevant frequency domain.) $\endgroup$ – Emilio Pisanty Aug 8 '16 at 13:46
  • $\begingroup$ This whole question is standard window theory in signal processing. I enjoy seeing some of it, but it does not merit this long set of answers and discussion. It is simply a sinc function, and subtract what ever he wants. If he doesn't know what the windowing effect is a simpler answer with a couple references for him to read would have been better - in my view $\endgroup$ – Bob Bee Aug 9 '16 at 4:17
3
$\begingroup$

Lets take a step back and look at this logically without using much math or frequency domain abstractions because what you start with is a time domain signal, and you also want your end result to be a time domain signal which you can listen to.

You know what silence sounds like. It is a pure DC signal of any amplitude in your speaker which may also include the special case of 0 signal amplitude. It can also be an AC signal(including all harmonics) that resides completely above, or completely below an individual's auditory range.

You know what a sine wave sounds like. It is a pure AC signal in your speaker.

What you termed the sound of "silence" is the click/pop heard at the beginning or end of a digital audio program without an edge filter in place. It is a well known phenomenon but most work aims to eliminate it, not isolate it.

You want to isolate only the transitions, the few samples that are clearly not DC, but still too early in the sine period or too late to be recognized as a sine wave when viewed(heard) on its own. That is what you want to listen to.

It is certainly possible with direct digital synthesis to generate the signal you want to hear. I would personally use these tools because I am familiar with them and I would like to use knobs to vary frequency, window placement, and phase. But I am sure there are pure software solutions you can run on your computer.

Where the initial transition ends, and final transition begins is not completely clear. So my implementation would allow varying those points and listening to several iterations to see if I could notice any difference.

To simplify things we'll look at the single case that involves the inflection points.

Beginning with 0v DC signal left of t.0,

then low frequency audible sine from t.0 to t.pi1/2,

inaudible,

then low frequency audible sine from t.pi3/4 to t.pi2,

finally 0v DC signal right after t.pi2.

Or, from ground up to the top of the hill, inaudible, then from bottom of valley up to ground.

The problem is the inaudible portion. It needs to join the top of the hill to the bottom of the valley. You cannot just splice the 2 ends together because that would be a discontinuous signal. You cannot insert a DC level because that would not join the discontinuities, you cannot join the points with a straight line because that would produce an audible signal.

The solution is to substitute the removed central portion of the original sine wave with the similar portion of a subaudible sine wave.

In order to minimize noise from change of slope at the join points, the 2 frequencies should be as close as possible while still being clearly audible/inaudible. Such as audible 160Hz, inaudible 20Hz.

Adjust as necessary to suit your personal hearing abilities. Amplitude of inaudible section and length of original program need to be adjusted to match the join points. To simplify, the audible frequency should be an even multiple of the inaudible. For our example, use 8 periods of 160Hz. remove all but the beginning and ending transition and replace with 1 period of 20Hz.

piecewise function if t < 0, v = 0

if t >= 0 && t < 0.0015625, v(t) = sin(2*pi*160)

if t >= 0.0015625 && t < 0.0015625+0.0375, v(t) = sin(2*pi*20 + pi/16)

if t >= 0.0390625 && t < 0.0390625+0.0015625, v(t) = sin(2*pi*160)

if t > 0.040625, v - 0

(I'll work on formating in an edit)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.