# How to visualize frequency domain of signal with multiples of $f_s$?

Is it possible to visualize signal in frequency domain for frequencies bigger than $$f_s$$?

I'd like to get the plot of some example signal like that:

I tried to create some signals in Python with different relation of signal frequency and sampling frequency, but I wasn't succeed((

original code:

f_sampling = 2e6
f_sig1 = 700e3

t = np.arange(0,50e-3,0.01e-6)
t_sample = np.arange(0, len(t)*1/f_sampling, 1/f_sampling)

plt.figure(figsize=(15,5))

signal_test = np.cos(2*np.pi*f_sig1*t)
f1 = np.cos(2*np.pi*f_sig1*t_sample)

plt.plot(t, signal_test, label='CW')
plt.plot(t_sample, f1, marker='o', label='digitized')

plt.xlim(0, 50e-6)
plt.legend(loc='lower center')

adding 2 zeros between each sample and FFT of it:

zero_data = []

for i in f1:
zero_data.append(i)
zero_data.append(0)
zero_data.append(0)

zero_data = np.asarray(zero_data)

t_zeros = np.linspace(0,len(zero_data)*t_sample[1], len(zero_data))

FFT = np.fft.fft(zero_data*3)
freqs_fft = np.fft.fftfreq(len(zero_data*3), t_zeros[1])

which outputs:

here I didn't get frequencies above $$f_s$$

And another question - why do we have $$f_s$$ of signal in frequency domain?

• Do you know what aliasing is ? Dec 27, 2021 at 14:07
• @Hilmar, yes. But I have no idea, how sampling frequency occurs in frequency domain and is it possible to visualize it in Python for example. Dec 27, 2021 at 14:16
• @Curious if you know what aliasing is, then you already know what the spectrum outside the nyquist bandwidth looks like, so what's the question? Dec 27, 2021 at 14:36
• @MarcusMüller, I don't exactly get, why do I see $f_s$ in the spectrum? in the explanation of aliasing this fact (the presence of $f_s$) is assumed as it is without explanation. Dec 27, 2021 at 21:10
• I don't understand the problem. you don't need to know $f_s$ to make a plot relative to $f_s$. Exactly as the plot you show! Dec 27, 2021 at 21:28

To visualize the frequencies of discrete time signals beyond the sampling rate, simply insert $$M-1$$ zeros in between each sample and scale the signal by $$M$$. This will extend the frequency axis by $$M$$ where $$M$$ is any positive integer. What you will see is the periodicity in the frequency domain as given for discrete time signals.
• ok, for example, I'll insert 2 zeros at sampling distance between each sample and what do you mean next - scaling the signal by $M$? Dec 28, 2021 at 14:19