Skip to content

Instantly share code, notes, and snippets.

@nihalpasham
Last active April 12, 2020 04:24
Show Gist options
  • Save nihalpasham/aeaa793f6cdfed04e8c405f179c41fff to your computer and use it in GitHub Desktop.
Save nihalpasham/aeaa793f6cdfed04e8c405f179c41fff to your computer and use it in GitHub Desktop.
DSSS - FFT plot of spread Vs despread signals
f = signal.resample(mot, 512)
N = 512
# sample spacing
T = 1.0 / 12000.0
yf = fft(f)
xf = fftfreq(N, T)
xf = fftshift(xf)
yplot = fftshift(yf)
f1 = signal.resample(z, 512)
N = 512
# sample spacing
T = 1.0 / 12000.0
yf1 = fft(f1)
xf1 = fftfreq(N, T)
xf1 = fftshift(xf1)
yplot1 = fftshift(yf1)
fig, (ax1, ax2) = plt.subplots(2, figsize=(30,20))
# fig.suptitle('Vertically stacked subplots')
ax1.plot(xf, 1.0/N * np.abs(yplot))
ax1.set(xlabel='Frequency', ylabel='Magnitude')
ax1.set_title('Fourier transform of De-Spread/Un-Mixed wave', fontsize=20, fontweight="bold")
ax2.plot(xf1, 1.0/N * np.abs(yplot1))
ax2.set(xlabel='Frequency', ylabel='Magnitude')
ax2.set_title('Fourier transform of Spread/Mixed wave', fontsize=20, fontweight="bold")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment