Skip to content

Instantly share code, notes, and snippets.

@Steboss
Created August 12, 2020 15:36
Show Gist options
  • Save Steboss/efb791e9d5a2498240a6f98c1e31230d to your computer and use it in GitHub Desktop.
Save Steboss/efb791e9d5a2498240a6f98c1e31230d to your computer and use it in GitHub Desktop.
#translate the pointer to a numpy array
magnitude_array = np.asarray(magnitude)
#reshape the magnitude_array so we'll have a matrix
cols = int( (length/(windowSize/2)) -1)
rows = int(windowSize/2)+1
new_array = np.zeros([cols,rows])
counter = 0
for i in range(0,cols):
for j in range(0,rows):
new_array[i][j] = magnitude_array[counter]
counter+=1
return new_array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment