sourcecode_fs.py
def plotWaves(waves):
    """ Main plotting function for RandomWave. Also sums waves to produce signal

        ----------

        Parameters

        ----------

        waves: array_like
            noWavesx3 array that contains amplitude, angular velocity and horizontal shift of each wave
    """
    _, (rawAx, compAx, ampAx) = plt.subplots(3,figsize=(16,10))
    x = np.arange(0,2*np.pi,0.01)
    out = 0
    for wave in waves:
        a, f, s = wave
        w = 2*np.pi*f
        out += a*np.sin(w*x-s)
        
        compAx.plot(x, a*np.sin(w*x-s), ls="--",linewidth=0.5)
    
    rawAx.plot(x, out, linewidth=2)
    freqAmp = np.array(waves).T
    order = np.argsort(freqAmp[1])
    freq = freqAmp[1][order]
    amp = freqAmp[0][order]
    ampAx.bar(freq, amp, width=0.1)
    
    compAx.set_title("Broken into Components")
    rawAx.set_title("Raw Signal")
    ampAx.set_xlim(minf,maxf)
    ampAx.set_xlabel("Frequency")
    ampAx.set_ylabel("Amplitude")
    ampAx.set_title("Frequency vs. Amplitude of Components")

    compAx.xaxis.set_ticklabels([])
    compAx.yaxis.set_ticklabels([]) # Removing all trace of axis labels because it looks prettier
    rawAx.xaxis.set_ticklabels([])
    rawAx.yaxis.set_ticklabels([])
    
    compAx.yaxis.set_ticks([])
    rawAx.xaxis.set_ticks([])
    compAx.xaxis.set_ticks([])
    rawAx.yaxis.set_ticks([])
    plt.show()
 Main plotting function for RandomWave. Also sums waves to produce signal

        ----------

        Parameters

        ----------

        waves: array_like
            noWavesx3 array that contains amplitude, angular velocity and horizontal shift of each wave
    
Main plotting function for RandomWave. Also sums waves to produce signal
Parameters



array_like
noWavesx3 array that contains amplitude, angular velocity and horizontal shift of each wave
Main plotting function for RandomWave . Also sums waves to produce signal Parameters array_like noWavesx3 array that contains amplitude angular velocity and horizontal shift of each wave
def plotWaves(waves):
    _, (rawAx, compAx, ampAx) = plt.subplots(3,figsize=(16,10))
    x = np.arange(0,2*np.pi,0.01)
    out = 0
    for wave in waves:
        a, f, s = wave
        w = 2*np.pi*f
        out += a*np.sin(w*x-s)
        compAx.plot(x, a*np.sin(w*x-s), ls="--",linewidth=0.5)
    rawAx.plot(x, out, linewidth=2)
    freqAmp = np.array(waves).T
    order = np.argsort(freqAmp[1])
    freq = freqAmp[1][order]
    amp = freqAmp[0][order]
    ampAx.bar(freq, amp, width=0.1)
    compAx.set_title("Broken into Components")
    rawAx.set_title("Raw Signal")
    ampAx.set_xlim(minf,maxf)
    ampAx.set_xlabel("Frequency")
    ampAx.set_ylabel("Amplitude")
    ampAx.set_title("Frequency vs. Amplitude of Components")
    compAx.xaxis.set_ticklabels([])
    compAx.yaxis.set_ticklabels([]) 
    rawAx.xaxis.set_ticklabels([])
    rawAx.yaxis.set_ticklabels([])
    compAx.yaxis.set_ticks([])
    rawAx.xaxis.set_ticks([])
    compAx.xaxis.set_ticks([])
    rawAx.yaxis.set_ticks([])
    plt.show()
def plotWaves ( waves ) : _ , ( rawAx , compAx , ampAx ) = plt . subplots ( 3 , figsize = ( 16 , 10 ) ) x = np . arange ( 0 , 2 * np . pi , 0.01 ) out = 0 for wave in waves : a , f , s = wave w = 2 * np . pi * f out += a * np . sin ( w * x - s ) compAx . plot ( x , a * np . sin ( w * x - s ) , ls = "--" , linewidth = 0.5 ) rawAx . plot ( x , out , linewidth = 2 ) freqAmp = np . array ( waves ) . T order = np . argsort ( freqAmp [ 1 ] ) freq = freqAmp [ 1 ] [ order ] amp = freqAmp [ 0 ] [ order ] ampAx . bar ( freq , amp , width = 0.1 ) compAx . set_title ( "Broken into Components" ) rawAx . set_title ( "Raw Signal" ) ampAx . set_xlim ( minf , maxf ) ampAx . set_xlabel ( "Frequency" ) ampAx . set_ylabel ( "Amplitude" ) ampAx . set_title ( "Frequency vs. Amplitude of Components" ) compAx . xaxis . set_ticklabels ( [ ] ) compAx . yaxis . set_ticklabels ( [ ] ) rawAx . xaxis . set_ticklabels ( [ ] ) rawAx . yaxis . set_ticklabels ( [ ] ) compAx . yaxis . set_ticks ( [ ] ) rawAx . xaxis . set_ticks ( [ ] ) compAx . xaxis . set_ticks ( [ ] ) rawAx . yaxis . set_ticks ( [ ] ) plt . show ( )
Main plotting function for RandomWave.
Main plotting function for RandomWave .
""" Main plotting function for RandomWave. Also sums waves to produce signal

        ----------

        Parameters

        ----------

        waves: array_like
            noWavesx3 array that contains amplitude, angular velocity and horizontal shift of each wave
    """ # Removing all trace of axis labels because it looks prettier
waves