<jupyter_start><jupyter_text>592B, Class 11.2 (11/14). Filtering review<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import scipy.io.wavfile as wavfile 
import scipy.signal as signal
from scipy import fftpack

from ipywidgets import interactive
from IPython.display import Audio, display<jupyter_output><empty_output><jupyter_text>Review question: filtering and "translating" to cepstral analysisRemember this from last week? Here I've chosen a small frequency for `y1` and a higher frequency for `y2`.<jupyter_code>def plot_play_summed_sines(f1 = 50, f2 = 880, t_start = 0, t_stop = 1, fs = 2000, xlim_max = 0.01):
    x = np.linspace(t_start, t_stop, fs * (t_stop - t_start))
    y1 = np.sin(2*np.pi*f1*x)
    y2 = np.sin(2*np.pi*f2*x)
    
    plt.xlim(t_start,xlim_max)
    plt.plot(x , y1, "-g", label="y1") 
    plt.plot(x , y2, "-b", label="y2") 
    plt.plot(x , y1 + y2, "-r", label="y1+y2") 
    plt.legend(loc="upper right") 
    plt.xlabel('Time (s)')
    plt.ylabel('Amplitude (dB)')
    plt.title("Adding up sines") 
    
    display(Audio(data=y1, rate=fs))
    display(Audio(data=y2, rate=fs))
    display(Audio(data=y1+y2, rate=fs))
    
    return (x, y1, y2) #I've added this return line. What does this do?
x, y1, y2 = plot_play_summed_sines()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13948170731707318, 'fraction_numerical': 0.038109756097560975, 'mean_word_length': 4.189723320158103, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '3143', 'license': 'MIT', 'n_tokens_mistral': 558, 'n_tokens_neox': 528, 'n_words': 127, 'path': 'class_11-2/592B-F19-class_11-2.ipynb', 'repo_name': 'ling592b-f19/592b-f19-class', 'size': '1312'}