I am beginning my journey on trying to understand a little deeper on signal processing. I wonder if the effect I am seeing is worth any spit or is there a deeper level of understanding is apparent I do not grasp.

I was initially using Jupyter Notebook to make some examples of Aliasing so that I could see the frequency foldback, and give myself a workspace to intuitively understand this concept. And after playing around with drawing sine waves, If I didn't create a sine wave at frequencies based on power 2 of my "sampling rate" then I would create what looked like lobes in my sine wave.

My initial code looks like this

# Aliasing Example
import numpy as np
import matplotlib.pyplot as plot
import math

%matplotlib qt
# Number of samples
N = pow(2,14) # 16,384 Samples

# Sampling Frequency
Fs = pow(2,14) # 16,384 Samples/second

# Sampling Frequency
T = 1/Fs # 1 second of data

# The amount of sampling time
time = np.linspace(0.0,(N-1)*T,N)

#Nyquist Frequency
Fn = (Fs/2)

# Number of lobes
num_lobes = 4

#Signal 1
f1 = 4096 - num_lobes/4
str1 = "Sine Wave @" + str(f1) + "Hz"
w1 = 2*math.pi*f1
sig1 = np.sin(w1*time)

fig1 = plot.figure()
ax = fig1.add_subplot()

The plot of the above graph looks something likeenter image description here

It looks like there is an accumulation of phase difference based between my "sampling frequency" of 16384 Hz and the signal frequency 4097 Hz. I don't think I have explored if this actually means anything? Does this have any real-world implications on how I capture data? On a relationship I need to try to satisfy to correctly recreate/capture data? That if I run an FFT or get any other signal information, am I still getting the correct value on the power of the spectrum?

I guess I am looking at this thinking if I were to capture this on a scope I would think I am getting multiple signals going on at once, but it's only a single wave. And that I don't have proper understanding of setting sampling for my signals of concern?

  • $\begingroup$ Your graph is perfectly fine & correct. Why do you think there is something wrong or unusual about it ? What did you expect to see ? $\endgroup$
    – Hilmar
    Sep 4, 2020 at 19:30

1 Answer 1


You're just seeing the amplitude of the individual samples, not the wave that travels between them. If you generate a high-frequency sine wave, you will see that the samples don't necessarily go anywhere close to the actual peaks of the wave.
At some points, it looks like you might expect, with samples near the peaks of the waveform:

enter image description here

but at others, the samples are not near the actual peak of the waveform:

enter image description here

(These are both from a 12.001 kHz wave viewed in Ocenaudio sampled at 48 kHz)

If you are displaying only the samples (as you are in matplotlib because it does only linear interpolation between them), then you will see this as "lobes" that go up and down as the samples move closer and farther from the actual peaks. But the actual waveform the samples represent does not go up and down, it's constant.


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.