<jupyter_start><jupyter_text>Demo dftmatrixexamplesDemonstrate the kernel matrix for the DFT Transform.  Imports<jupyter_code>import sys,os
%matplotlib inline
ia898path = os.path.abspath('/etc/jupyterhub/ia898_1s2017/')
if ia898path not in sys.path:
    sys.path.append(ia898path)
import ia898.src as ia
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from numpy.fft import fft2
from numpy.fft import ifft2<jupyter_output><empty_output><jupyter_text>Função iadftmatrix SynopseKernel matrix for the 1-D Discrete Fourier Transform DFT.- **A = iadftmatrix(N)**    - **N**:Input: Integer, number of points of the DFT.    - **A**:Output image, square N x N, complex<jupyter_code>def iadftmatrix(N):
    x = np.arange(N).reshape(N,1)
    u = x
    Wn = np.exp(-1j*2*np.pi/N)
    A = (1./np.sqrt(N)) * (Wn ** np.dot(u, x.T))
    return A<jupyter_output><empty_output><jupyter_text>Kernel images generatedImaginary and real parts of the DFT kernel.<jupyter_code>A = iadftmatrix(128)

plt.figure(1)
plt.imshow((A.real),cmap='gray')
plt.title('A.real')
plt.colorbar()

plt.figure(2)
plt.imshow((A.imag),cmap='gray')
plt.title('A.imag')
plt.colorbar()<jupyter_output><empty_output><jupyter_text>Four first lines**Four first lines from real and imaginary parts of the kernel matrix. Observe the increasing frequencies of the senoidals(imaginary part) and cossenoidals (real part).**<jupyter_code>plt.figure(1, figsize=(10,10))

plt.subplot(2,2,1)
plt.title('u = 0')
plt.plot(A.real[0,:], 'r')
plt.plot(A.imag[0,:], 'g')

plt.subplot(2,2,2)
plt.title('u = 1')
plt.plot(A.real[1,:], 'r')
plt.plot(A.imag[1,:], 'g')

plt.subplot(2,2,3)
plt.title('u = 2')
plt.plot(A.real[2,:], 'r')
plt.plot(A.imag[2,:], 'g')

plt.subplot(2,2,4)
plt.title('u = 3')
plt.plot(A.real[3,:], 'r')
plt.plot(A.imag[3,:], 'g')

plt.show()<jupyter_output><empty_output><jupyter_text>Showing complex conjugates<jupyter_code>plt.figure(1, figsize=(10,10))

plt.subplot(2,2,1)
plt.title('u = 0')
plt.plot(A.real[ 0,:], 'r')
plt.plot(A.imag[ 0,:], 'g')

plt.subplot(2,2,2)
plt.title('u = -1')
plt.plot(A.real[-1,:], 'r')
plt.plot(A.imag[-1,:], 'g')

plt.subplot(2,2,3)
plt.title('u = -2')
plt.plot(A.real[-2,:], 'r')
plt.plot(A.imag[-2,:], 'g')

plt.subplot(2,2,4)
plt.title('u = -3')
plt.plot(A.real[-3,:], 'r')
plt.plot(A.imag[-3,:], 'g')

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20480404551201012, 'fraction_numerical': 0.03792667509481669, 'mean_word_length': 5.539944903581267, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '221434', 'license': 'MIT', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1043, 'n_words': 193, 'path': 'master/dftmatrixexamples.ipynb', 'repo_name': 'jamfeitosa/ia898', 'size': '2373'}