@staticmethod
	def draw_spectrum_analyzer(all_frames, thresh_frames):
		time.sleep(1) # Wait just one second
		pw = pg.plot(title="Spectrum Analyzer") # Window title
		pg.setConfigOptions(antialias=True) # Enable antialias for better resolution
		pw.win.resize(800, 300) # Define window size
		pw.win.move(540 * SCREEN_WIDTH / 1920, 500 * SCREEN_HEIGHT / 1080) # Define window position
		while True: # Loop over the frames of the audio / data chunks
			data = ''.join(all_frames[-1:]) # Get only the last frame of all frames
			data = numpy.fromstring(data, 'int16') # Binary string to numpy int16 data format
			pw.setMouseEnabled(y=False) # Disable mouse
			pw.setYRange(0,1000) # Set Y range of graph
			pw.setXRange(-(RATE/16), (RATE/16), padding=0) # Set X range of graph relative to Bit Rate
			pwAxis = pw.getAxis("bottom") # Get bottom axis
			pwAxis.setLabel("Frequency [Hz]") # Set bottom axis label
			f, Pxx = HearingPerception.find_frequency(data) # Call find frequency function
			f = f.tolist() # Numpy array to list
			Pxx = (numpy.absolute(Pxx)).tolist() # Numpy array to list
			try: # Try this block
				if thresh_frames[-1:][0] == EMPTY_CHUNK: # If last thresh frame is equal to EMPTY CHUNK
					pw.plot(x=f,y=Pxx, clear=True, pen=pg.mkPen('w', width=1.0, style=QtCore.Qt.SolidLine)) # Then plot with white pen
				else: # If last thresh frame is not equal to EMPTY CHUNK
					pw.plot(x=f,y=Pxx, clear=True, pen=pg.mkPen('y', width=1.0, style=QtCore.Qt.SolidLine)) # Then plot with yellow pen
			except __HOLE__: # If we are getting an IndexError because of this -> thresh_frames[-1:][0]
				pw.plot(x=f,y=Pxx, clear=True, pen=pg.mkPen('w', width=1.0, style=QtCore.Qt.SolidLine)) # Then plot with white pen
			pg.QtGui.QApplication.processEvents() # ???
			time.sleep(0.05) # Wait a few miliseconds

	# A function that will draw a waveform graphic to screen (PyQtGraph)
dataset/ETHPy150Open mertyildiran/Cerebrum/cerebrum/hearing/perception.py/HearingPerception.draw_spectrum_analyzer