Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: aliasing (Read 9127 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

aliasing

hi all
I was trying to make a disc of sounds for testing my soundsystem and especially mics.

I made up a 2 min. sweep from 0 -22k

I noticed that the sweep begins to falsely generate smaller audible full freq sweeps when it get to the upper registers.  I know aliasing isn't suppose to occur below 22kh for std cd 44.1 samples.  Is this a phenomena resulting from the transition between freq as it sweeps? or is something else going on at these higher freqs.
--
RockyJ

aliasing

Reply #1
If you're listening back through a PC soundcard, like an old SBLive or an internal, then you could be experiencing bad resampling to their native sampling rate, which is most likely 48kHz.

aliasing

Reply #2
Intermodulation, I think, between the fundamental and armonic distorsion components.
Sergio
M-Audio Delta AP + Revox B150 + (JBL 4301B | Sennheiser Amperior | Sennheiser HD598)

aliasing

Reply #3
This is most likely harmonics. How are you generating the signal? How are you looking at it?

aliasing

Reply #4
Quote
This is most likely harmonics. How are you generating the signal? How are you looking at it?
[a href="index.php?act=findpost&pid=362143"][{POST_SNAPBACK}][/a]


I used goldwave and did their preset generator.  Here's the formula.

sin(pi*t*(n/N/T/2))

If I set my soundcard to 48 sample rate on playback the aliased harmonics is different and less then setting it to 44 sample rate.

Goldwave shows the true wave output throughout on their spectrum analyzer.  It is an audible false(aliased} signal (harmonics).

my card is chaintech's AV710 based on the via envy24HT chip.
--
RockyJ

aliasing

Reply #5
Quote
hi all
I was trying to make a disc of sounds for testing my soundsystem and especially mics.

I made up a 2 min. sweep from 0 -22k

I noticed that the sweep begins to falsely generate smaller audible full freq sweeps when it get to the upper registers.  I know aliasing isn't suppose to occur below 22kh for std cd 44.1 samples.  Is this a phenomena resulting from the transition between freq as it sweeps? or is something else going on at these higher freqs.
[a href="index.php?act=findpost&pid=362116"][{POST_SNAPBACK}][/a]


If you're doing a sweep, then you have frequency componets above the current "point" on sweep because the signal isn't a constant sin wave.  For example, if you're sweeping, and should alias at 22.05 Hz, you'll actually alias a little sooner since the waveform has higher frequency componets. 

At least I think thats how it works.  I never bothered to FT a frequency sweep, but they do alias earlier then you'd expect, so I assume thats the case

aliasing

Reply #6
I don't have Goldwave and of course not the rest of your system, whatever the heck it is. However, the reasonable assumption here is that if you generate the sweep tone and look at the result with this spectrum analyzer you do not see these extra components, yes? It is only after using the sweep tone in some way that passes it through your soundcard that the symptoms appear? It would be so much easier to get a brief but complete description of what is involved so it doesn't have to be pried out bit by bit.

If this extra stuff shows up only after the signal passes through some piece or pieces of hardware, it would seem probable that something in the chain is generating harmonics; perhaps it is intermodulation distortion. These higher frequency harmonics exceed the Nyquist limit for your sampling rate and the soundcard filters let through alias images.

I have tested several well though of cards by feeding them sweep tones going up to 48kHz. Regardless of the filter specs and the 64X over sampling that most employ, they all let through alias images when recording at 44.1kHz or 48kHz. These are rather strong at the highest frequencies but are probably at too low a level to be significant when the input is real music.

The soundcard is not necessarily a problem here except that if it does the 48kHz resample thing, it adds it own symptoms to the primary ones when used at 44.1kz. When I ran my test on such a sound card it was easy to see that the recording properties (and no doubt the playback ones too) are much dirtier at 44.1kHz.

aliasing

Reply #7
Goldwave editor shows the correct freq, graphically, but I can hear the aliased tone.

I can't figure out how to attach the jpg of the graph but rest assured the wave file is correctly formed and goldwave indicates that.

But I think the aliasing comes from the sweep in such that the proximity of the waves is causing an aliased tone.  I may try another at an extended time interval to see if it does it.

But I really thought this would be a matter of fact not a problem with my soundcard dsp, and the answer would be simple for everyone (but me of course).

I guess I have to ask isn't the nyquist limit at half the sample rate?

these are occurring in 44.1 sampling at the 19khz.

sorry for not answering better but I am not the most expert at DSP.
--
RockyJ

aliasing

Reply #8
try to explain what you are doing. I still can't guess very much. e.g.
1) generate sweep tone in GW at 16bit/44.1kHz
2) look at sweep tone with spectrum analyzer. I see ...
3) play sweep tone in GW through sound card to ... ? and record?
4) play back recorded sweep tone from ... through sound card to GW and record in GW
5) look at sweep tone with spectrum analyzer and ... is different than original
What is going on? What do you do to see and hear what you see and hear? When is the soundcard involved? What other equipment is used? This information will be much more valuable for understanding than any jpg.

Don't make us guess about what you do to get the results you get.

Yes, the Nyquist limit is 1/2 the sample rate frequency.

Quote
these are occurring in 44.1 sampling at the 19khz.


"these" are traces seen via the spectrum analyzer in some signal -- after it has passed through your soundcard -- but not before?
"19kHz" is the frequency they show up at in the spectrum analyzer?

There are always alias images generated. They are essentially a complete image of the audio, full spectrum, centered at each multiple of the sampling frequency. This is probably not what you are seeing, as least as regards the fundemental of your sweep tone, but the whole thing is rather murky right now.

The images I mentioned, from my tests (input sweeping from 1kHz to 48kHz), were from the part of the input sweep tone that exceed the Nyquist limit of the recording I was making. Your sweep tone (as far as I can tell) does not extend beyond the Nyquist limit you are utilizing but it sounded as though you saw harmonics, in addition to the tone you originally generated. Those would exceed the Nyquist limit of the recording sample space and thust could, as in my tests, produce image traces. Unfortunately this is all a big guess because I don't acutally know what you are doing.

To post an image on this forum you must put it someplace else on the internet and provide a link in your post. This site http://www.putfile.com/ provides free disk space if you don't have somewhere else already.

aliasing

Reply #9
Quote
I guess I have to ask isn't the nyquist limit at half the sample rate?

iirc yes, however it idealy relates to unchanging signals of infinite length (!)

Its easy to visualise how oscillations near or at nyquist limit of half the sampling rate are ambiguously represented.

eg. imagine observing an unusual astronomical object at a hundred frames a second, which seems to be blinking bright/dim every other frame but increasing in brightness and decreasing in brightness over a period of 50 frames.
The amplitude of the objects oscillation may be constant and its period my be slighlty below the nyquist frequency @ 2+1/50th of frame, or its amplitude may be oscillating at a period of 50 frames and its quicker period at the nyquist limit of 2 frames.
In other words the blinking star may be getting brighter and dimmer over a longer period, or it may be constant with a different primary blink speed. The only way to tell is observe at a higher sample rate.

iirc the nyquist model commonly envolked does not deal with variations of oscillation power, or (oscillation of (oscillation)), or any change in oscillation such as a sine sweep involves. The nyquist limit should be considered the last observable frequency region of the waveform, with ambiguity increasing as its approached, until when you are at the nyquist limit, any appearance of oscillation noticed at half the sampling rate we have no idea what its phase or power is. It will aways be likely to be more powerful than observed, but there is no way of observing the powers at different moments of the signals period, when the signal and the sample rate are perfectly in step.

In my own experiments, waveform interpration does get messy above ~85% of nyquist limit.

hth
no conscience > no custom

aliasing

Reply #10
I see I've confused my question somewhat.

the sweep sound file (standard 44.1 2x2 cdda format) that I refer to is simply a mathematical generated wav file of 44.1 sample rate with the formula I referenced.  It goes from 0 to 22khz in 2minutes.

When I play it back in GW the analyzer shows the ascending frequency in the spectrum graph and the spectrogram.  It doesn't show any harmonics or a aliased frequency.  However, when I listen to the playback it mimics several cycles of an audible sweep when it reaches around 19khz.

I just generated another sweep file of 30minute duration and can pinpoint ithe audible portion between 18800 and 19800.

I don't think it is the sound card.  But I do think it seems to indicate that audio files should be high band filtered above 18k at all times even for lossless format.
--
RockyJ


aliasing

Reply #12
to play further... I generated a 19000hz file and to my ears it is identical to a 1000hz tone only 36db lower.
--
RockyJ

aliasing

Reply #13
Quote
I just generated another sweep file of 30minute duration and can pinpoint ithe audible portion between 18800 and 19800.

Since your listening to full amplitude (maximum strength) sines, the 19 khz tone is extremely loud, but of course not hardly heard. I think these quiet lower tones are the expression of rounding error, which would be totaly masked if we could hear the real tone.
Quote
I don't think it is the sound card.  But I do think it seems to indicate that audio files should be high band filtered above 18k at all times even for lossless format.

This demonstration is not very representative, but its an option.
no conscience > no custom

aliasing

Reply #14
yes, I see I didn't think it through.  Normally you won't encounter maximum tones in that range.  So even if there is an undertone it would be -36 db of the 19k tone which would be more like -30db anyway.

Thanks all for replies.
--
RockyJ

aliasing

Reply #15
You will get aliasing even below the Nyquist frequency.  Here is a little diagram to explain why.  Suppose you sample a 17.6kHz sine wave at 44.1kHz:
Code: [Select]
 |   |   |   |   |   |   |   |   |   |   |
  **        **        **        **
 *  *      *  *      *  *      *  *
*    *    *    *    *    *    *    *    *
      *  *      *  *      *  *      *  *
       **        **        **        **
|   |   |   |   |   |   |   |   |   |   |

This is 4/5 of the Nyquist frequency.  You get these samples:
Code: [Select]
             *                   *
    *                   *
*                   *                   *
                *                   *
        *                   *

Now connect the dots.  Not such a nice sine wave anymore is it? 

aliasing

Reply #16
Quote
...
Now connect the dots.  Not such a nice sine wave anymore is it? 
[a href="index.php?act=findpost&pid=362437"][{POST_SNAPBACK}][/a]


Your not_so_nice_sine_wave will be perfectly nice (and equal to the original) when correctly lowpassed at the Nyquist frequency. 

Sergio


Edit: BTW: playing with 19KHz at 0dB is a risky game. The risk is to fry your tweeters (and your ears).
Sergio
M-Audio Delta AP + Revox B150 + (JBL 4301B | Sennheiser Amperior | Sennheiser HD598)

aliasing

Reply #17
Quote
Your not_so_nice_sine_wave will be perfectly nice (and equal to the original) when correctly lowpassed at the Nyquist frequency.  
[a href="index.php?act=findpost&pid=362445"][{POST_SNAPBACK}][/a]

And how many soundcards have such perfect filters?

aliasing

Reply #18
Quote
You will get aliasing even below the Nyquist frequency.  Here is a little diagram to explain why.  Suppose you sample a 17.6kHz sine wave at 44.1kHz:
Code: [Select]
 |   |   |   |   |   |   |   |   |   |   |
  **        **        **        **
 *  *      *  *      *  *      *  *
*    *    *    *    *    *    *    *    *
      *  *      *  *      *  *      *  *
       **        **        **        **
|   |   |   |   |   |   |   |   |   |   |

This is 4/5 of the Nyquist frequency.  You get these samples:
Code: [Select]
             *                   *
    *                   *
*                   *                   *
                *                   *
        *                   *

Now connect the dots.  Not such a nice sine wave anymore is it? 
[a href="index.php?act=findpost&pid=362437"][{POST_SNAPBACK}][/a]


Are you being serious?  I can't really tell.  If so, you don't connect the dots with a strange line, and with a reasonably good dac you will get essentially a perfect reproduction (well minus quant error, so its not perfect, but you get the idea).  With a good enough DAC, you can get arbitrarily close to the Nyquist frequency.

For instance, my National Instruments DAC has pretty much flat reproduction up to .45 of the sample frequency, and relatively good performance up to about .48.  Pretty damn good, and I'm sure you can do better if you want to spend the money.

aliasing

Reply #19
Quote
Quote
Your not_so_nice_sine_wave will be perfectly nice (and equal to the original) when correctly lowpassed at the Nyquist frequency.  
[a href="index.php?act=findpost&pid=362445"][{POST_SNAPBACK}][/a]

And how many soundcards have such perfect filters?
[a href="index.php?act=findpost&pid=362448"][{POST_SNAPBACK}][/a]


I desist!
Sergio
M-Audio Delta AP + Revox B150 + (JBL 4301B | Sennheiser Amperior | Sennheiser HD598)

aliasing

Reply #20
Nayru is correct, the dots(samples) at high frequency are very arbitrary looking.  But any DAC is able to form the correct sine wave analog output below the N threshold.

I always thought it challenging to understand the math behind it.
--
RockyJ

aliasing

Reply #21
Signal graphs like those depicted in Nayru's post are misleading, because analog data is not reconstructed from digital by simply connecting the dots.  Most DACs perform oversampling to compensate for problems associated with real filtering, managing to achieve very good analog reproduction.  A signal like the 17.6kHz sine wave in the graph is a very managable distance below the cutoff frequency designed for the 44.1kHz sampling rate.  The extra 2.2kHz/4.1khz bandwidth for the 44.1kHz sampling rate was designed from the start to account for real filters, allowing for filter distortions above 20kHz.

As for the harmonics, I expect the speakers you're using simply can't cope with the high-frequency, high-volume audio signals being sent to them.  The speakers themselves therefore become lowpass filters, distorting the sound.  Purchase some diamond-plated tweeters if you really desire to "hear" such frequencies.

If you want to test out your hardware, try using a program like Rightmark which can give you a frequency response graph that does not depend on your ears.

aliasing

Reply #22
Quote
As for the harmonics, I expect the speakers you're using simply can't cope with the high-frequency, high-volume audio signals being sent to them.

Try drawing a near full amplitude very high frequency sine at 16bits, with audacity or foobars tone generator and observe a spectrum - the lower harmonics can actualy be seen.
no conscience > no custom

aliasing

Reply #23
Quote
Nayru is correct, the dots(samples) at high frequency are very arbitrary looking.  But any DAC is able to form the correct sine wave analog output below the N threshold.

I always thought it challenging to understand the math behind it.
[a href="index.php?act=findpost&pid=362464"][{POST_SNAPBACK}][/a]


I meant Mike not Nayru.

Anyway of further interest and support that the anomaly is related to the full dynamic frequency, I can generate a reduced amplitude 19k frequency and turn the volume up on output and not get the low sound.  Yet genereating the full amplitude sound file will playback the lower frequency.

I think this points to a difference in the way the DA converts based on the amplitude.  Like I said before everything is interesting but in practicality this problem wouldn't ever come up because of lack of strength in the higher frequencies under normal audio conditions.
--
RockyJ