<commit_before>from __future__ import division
import rxcs
import numpy as np
import matplotlib.pyplot as plt

def _dict_IFFT_ex0():

    # -----------------------------------------------------------------
    # Generate settings for the IFFT dictionary

    # Start the dictionary with dictionary configuration
    dCSConf = {}

    # Time of the dictionary is 1 ms
    dCSConf['tS'] = 1e-3

    # The signal representation sampling frequency is 1 MHz
    dCSConf['fR'] = 1e4

    # The frequency separation between tones
    dCSConf['fDelta'] = 1e3

    # The number of tones in the dictionary
    dCSConf['nTones'] = 10

    # -----------------------------------------------------------------
    # Generate the IFFT dictionary
    rxcs.cs.dict.IFFTdict.main(dCSConf)
    #mIFFT = rxcs.cs.dict.IFFTdict.main(dCSConf)

    # -----------------------------------------------------------------
    # Generate the signal using the dictionary

    # -----------------------------------------------------------------
    # Plot the signal
<commit_msg>Simple example of using the IFFT dictionary is ready<commit_after>from __future__ import division
import rxcs
import numpy as np
import matplotlib.pyplot as plt

def _dict_IFFT_ex0():

    # -----------------------------------------------------------------
    # Generate settings for the IFFT dictionary

    # Start the dictionary with dictionary configuration
    dCSConf = {}

    # Time of the dictionary is 1 ms
    dCSConf['tS'] = 1e-3

    # The signal representation sampling frequency is 20 kHz
    dCSConf['fR'] = 4e4

    # The frequency separation between tones
    dCSConf['fDelta'] = 1e3

    # The number of tones in the dictionary
    dCSConf['nTones'] = 10

    # -----------------------------------------------------------------
    # Generate the IFFT dictionary
    (mIFFT, dDict) = rxcs.cs.dict.IFFToNoDC.main(dCSConf)

    # Get the signal time vector from the dictionary
    vT = dDict['vT']

    # -----------------------------------------------------------------
    # Generate the signal using the dictionary

    # Vector with Fourier coefficients
    vFcoef = np.zeros((1,20)).astype(complex)
    vFcoef[0, 0] = 1
    vFcoef[0, 19] = 1

    # Generate a signal and change its shape to a signle vector
    vSig = np.real(np.dot(vFcoef,mIFFT))
    vSig.shape = (vSig.size,)


    # -----------------------------------------------------------------
    # Plot signal in the time domain
    hFig1 = plt.figure(1)
    hSubPlot1 = hFig1.add_subplot(111)
    hSubPlot1.grid(True)
    hSubPlot1.set_title('Signal')
    hSubPlot1.set_xlabel('Time [s]')
    hSubPlot1.plot(vT, vSig)
    hSubPlot1.set_xlim(min(vT), max(vT))
    hSubPlot1.set_ylim(-1.1, 1.1)
    plt.show(block=True)
{'fraction_non_alphanumeric': 0.2612809315866084, 'fraction_numerical': 0.018195050946142648, 'mean_word_length': 1.5266544117647058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '890672', 'n_tokens_mistral': 826, 'n_tokens_neox': 757, 'n_words': 223}