0

I know from the sampling theorem, that the signal frequency $f_{sig}$ shouldn't exceed 0.5 of sampling frequency $f_{samp}$.

I decided to have a look at it and tried for example $f_{samp} = 50 $ $kHz$ and varied the signal frequency as parts of sampling frequency.

For $f_{signal} = 0.1\ f_{samp}$ sampling looks fine: enter image description here

but if I try $f_{signal} = 0.5\ f_{samp}$ digitizing failed: enter image description here

$1.$ my first question is why? does $0.5$ the upper limit for signal frequency in the sampling theorem?

Next, I decided to check the effect of aliasing and chose $f_{signal} = 0.51\ f_{samp}$: enter image description here

$2.$ my second question - why does it happen? I saw some explanations of it, but is not evident (I don't exactly get the physical reason of this effect).

Curious
  • 355
  • 1
  • 11
  • 1
  • yes, as any article on the Shannon-Nyquist sampling theorem will tell you. As to why: you're illustrating why here beatifully, so what's the question? 2. "why does aliasing alias to the frequencies it aliases to": could you elaborate on this question? It's a bit like you've read half an article on aliasing, and it's hard for us to know what exactly you need help with!
  • – Marcus Müller Nov 29 '21 at 17:10
  • $1.$ at $f_{signal}$=$0.5f_{samp}$, I can't see any sine-like oscillations, but the theorem states, that the signal shouldn't be bigger than $0.5f_{samp}$, am I right, I can't resolve any signal in this limit case (at $0.5f_{samp}$)? $2.$ the question is why does it happen? why digitizing adds in the frequency domain harmonics multiple of $f_{sampling}$ (I'd like to know the details of this effect)? – Curious Nov 29 '21 at 17:22
  • yes, have you read book section on aliasing? It's one of the fundamental concepts in DSP, and as said, it's a bit like you've read half an article on aliasing, and it's hard for us to know what exactly you need help with!
  • – Marcus Müller Nov 29 '21 at 17:30
  • 1
    not yet, but what about sampling at $f_{signal}=0.5f_{samp}$? and btw, I didn't see the chapter on aliasing. – Curious Nov 29 '21 at 18:12
  • 1
    If you haven't read something coherent on it, please don't be surprised if I say "hey, please read upon it as far as possible, and come back with a specific question", because, honestly, these are really the core things answered in any book on DSP. – Marcus Müller Nov 29 '21 at 18:17
  • UPD. the answer on my first question: my fault was, that I chose two signals inphase, so as I changed the phase of the signal - the answer to my question became clear (at $0.5f_{samp}$ I can digitize the signal correctly), but aliasing (because of digitizing, as I read) still unclear... – Curious Nov 29 '21 at 18:43
  • 2
    On your question 2, be careful not to be deceived by the plot, which is a simple linear interpolation between the samples. To see the actual wave shape, you need to interpolate between the samples. – MBaz Nov 29 '21 at 18:52
  • sure, but the plot in principle shows the tendency of sampled signal: here for $0.51f_{samp}$ sampled signal has frequency ~ $0.49f_{samp}$; but my question was in the reason of this effect? why does it happen? I read some explanations, but it is unclear for me, I would cheerfully read some explanatory notes on it. – Curious Nov 29 '21 at 19:04
  • 1
    @Curious what is the book you're currently reading on basics of digital signal processing? Maybe we can point you in the right direction. But really, aliasing during sampling, that's the first or second chapter on discrete signals in any textbook about digital signal processing, and we really can't write an answer that's shorter or better than a good book chapter. – Marcus Müller Nov 29 '21 at 19:18
  • @MarcusMüller, I'd be very appreciated if you point me in the right direction) I'm reading this book, here it is explained by use of impulse train approach and I didn't get, why it can introduce multiples of $f_{sampling}$ in the frequency domain of sampled signal. – Curious Nov 29 '21 at 19:33
  • @DanBoschen, very nice post, from which I got that $aliasing$ - is the effect of presence of "negative" frequency in the input signal; but I didn't exactly get how do you create example plots without negative component of input signal (or I misunderstood something). – Curious Nov 30 '21 at 09:51
  • @Curious yes, you're misunderstanding something. Negative frequencies and aliasing are two different things and not linked. – Marcus Müller Nov 30 '21 at 09:55
  • @MarcusMüller, if you'll have a look at Dan's post, you'll get what I mean: Dan shows one of the ways to exclude aliasing and next gives some plots as examples. If these issues are not related, Dan's post is wrong (I absolutely disagree with it, Dan's explanation very deep and elaborated). – Curious Nov 30 '21 at 10:00
  • @MarcusMüller, if these things are not related - can you give your correct explanation (as Dan did)? See plot Sampling of +8 Hz Complex Tone, from which it is evident, that these things are correlated. – Curious Nov 30 '21 at 10:06
  • Sorry, I don't understand what you're asking of me. Negative frequencies exist because of how we define what "frequency" is and what a Fourier transform does; aliasing is an effect of sampling and doesn't care about whether frequencies are negative or positive. – Marcus Müller Nov 30 '21 at 10:09
  • @MarcusMüller, did you see Dan's post? you say aliasing - is an effect of sampling unfortunately it doesn't explain this effect; if you know correct explanation of aliasing - why don't you make the answer to this question (with some examples)? – Curious Nov 30 '21 at 10:13
  • because I've said (three times now) that explaining that really just takes a book chapter on sampling, and you have a book chapter, and you haven't told us what you don't understand about it. – Marcus Müller Nov 30 '21 at 10:18
  • @MarcusMüller, I like the explanation in Dan's post (that's what I exactly asked for, his answer includes How Aliasing Can Occur, what else should be asked?). You state that aliasing and negative frequency of input signal are not related, it means that Dan's explanation is wrong, so could you give right in your opinion explanation? If it would be easier, I ask you: How Aliasing Can Occur? I don't understand it – Curious Nov 30 '21 at 10:25
  • no, Dan's explanation isn't wrong. Your interpretation, which I don't understand, might be. – Marcus Müller Nov 30 '21 at 10:27
  • again, now I'm asking for the fourth time to explain exactly what you don't understand. You just say "Dan's post", I ask "what specifically", same about DSPguide. This is the point where I give up, sorry. – Marcus Müller Nov 30 '21 at 10:29
  • Please, could you explain, how aliasing can occur. As I get for this moment (actually, from Dan's post), aliasing occurs if the input signal frequency spectrum has mirror frequency components (for example, $+8 Hz$ and $-8Hz$) and it CAN be ELIMINATED if one of the frequency components is removed (for example if the input frequency spectrum has only $+8 Hz$ component), what could be wrong in these judgements? – Curious Nov 30 '21 at 10:37
  • @Curious I agree with Marcus that negative frequencies and aliasing are two different things. If you have a question on the difference could you ask your question there (assuming that question does actually answer your question- so another duplication of that here is not needed). – Dan Boschen Nov 30 '21 at 11:26
  • @DanBoschen, I absolutely tangled then. In your post you show the example of aliasing effect in frequency domain (for just 8 Hz harmonic signal), then you show how to completely prevent this artefact and suggest to use only +8 Hz (complex) signal (in this case no alising occur), am I right at this stage? – Curious Nov 30 '21 at 11:42
  • @Curious please start a discussion there about that post under that post and we can clear up that part of your confusion. – Dan Boschen Nov 30 '21 at 11:43
  • do I need to push some button for it? I haven't ever started such discussion yet. – Curious Nov 30 '21 at 11:44
  • @Curious you just go to that answer (which I believe answers your question which would make this a duplicate) and then under that in the comments ask your question/clarification. It keeps it together with the content. – Dan Boschen Nov 30 '21 at 11:59
  • @DanBoschen, but I can't leave comments in your post, how can I open discussion then? I just can move this discussion to chat. – Curious Nov 30 '21 at 12:06
  • @Curious I am in the chat room... https://chat.stackexchange.com/rooms/131901/discussion-between-curious-and-dan-boschen – Dan Boschen Nov 30 '21 at 12:16