# Is it possible to lose half the samples, and yet see the full spectrogram as the original signal?

Consider an speech audio signal sampled at 16,000 samples per second. Plot its spctrogram.

If we delete every other sample from input signal, we get y[n] = x[2n] for all n.

It seems that if we plot the spectrogram of y[n], we would only see frequencies upto 4kHz on the Y axis (all frequencies above 4k would be zero). So this scheme of resampling is not useful.

Is it possible to do some operation on x[n], and get a signal (y[n]) with only 8000 samples per second, and yet see the complete frequency range 0Hz - 8kHz?

Of course, this will not be as accurate as the original spectrogram, but still I'm interested whether the information in original "4kHz - 8 kHz" frequency range is still somehow partially preserved after some resampling operation.

If yes, what's the mathematical formula for this new resampling scheme?

• First you have to specify the bandwidth of input speech signal to answer this question. – Ch.Siva Ram Kishore Dec 25 '18 at 10:29
• @Ch.SivaRamKishore there are frequencies present above 4kHz in speech signal. You can assume that input signal has all the frequencies upto 8kHz. – user87466 Dec 25 '18 at 10:33
• Then yes see for poly phase filters you should check it out. – Ch.Siva Ram Kishore Dec 25 '18 at 10:36

To rephrase your question: Is there a process that halves the number of samples of a full-bandwidth signal without significantly affecting the appearance of the spectrogram, except for scaling of time or frequency axes?

Resampling does not do that. The only such process I know of is time stretching / pitch scaling followed by decimation. Actually, one definition of time stretching / pitch scaling would be to "modify the signal so that the spectrogram is stretched".

Time stretching and pitch scaling are equivalent from the point of view that the number of samples needed to represent the processed signal changes. Time stretching to half the original length requires only half the number of samples, and pitch scaling to half the frequency allows to discard every second sample without causing aliasing, assuming that the empty upper part of the frequency spectrum is not filled by something made-up by the algorithm used.

Time stretching / pitch scaling does not have a unique definition or a unique mathematical formula. Well-done time stretching should match one's expectation of, in your case, "speeding up" the process that generated the audio. Speeding up natural processes is not uniquely defined. For example, should the pianist be made to move their fingers faster, resulting in changes in note attacks in the least, or should we be more agnostic of the actual process taking place and just isolate the notes in the audio and move them around into a more compact pattern? And should the note decay times be made shorter, too, because we want to make everything shorter? Depends on one's expectations or needs.

There are various algorithms though. Here are before and after spectrograms of the phrase "hello" (freesound), processed by rubberband -t0.5 speech16kHz.wav out.wav with Rubber Band v1.8.2 command line and analyzed in Adobe Audition 3.0 with 512 bands and Blackman–Harris window:

Figure 1. Top: original speech spectrogram, bottom: spectrogram of the speech time-stretched to half the original length and half the number of samples. The spectrograms are zoomed out to full view for easier comparison.

The spectrogram of the time-stretched signal looks essentially the same, but has reduced detail and resolution.

• I agree with this answer, but I think that for the uninitiated reader it should be made clear that the actual answer to the literal interpretation of the question is 'no'. This also as a counterweight to some non-sense comments under the question. – Matt L. Dec 26 '18 at 12:54
• @MattL. added "Resampling does not do that." – Olli Niemitalo Dec 26 '18 at 13:52
• @MattL. If I take some liberties with the question, I could form the analytic version of the signal (with zero negative frequencies), and downsample that by a factor of two without aliasing. The “liberty” I take is to allow complex samples now. – Peter K. Dec 26 '18 at 16:02
• @PeterK.: That's right, but the number of (real-valued) samples per second remains the same, so we can't fool nature/math/Shannon (just ourselves ... :) – Matt L. Dec 26 '18 at 16:38
• @MattL. Oh, understood. That’s part of what I meant by “taking liberties”. 😜 – Peter K. Dec 26 '18 at 18:59