Skip to content

Commit

Permalink
better visualisation for compIAM pitch
Browse files Browse the repository at this point in the history
  • Loading branch information
genisplaja committed Apr 19, 2024
1 parent 63fd675 commit cd8f797
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions webbook/introduction/compiam.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -428,33 +428,7 @@
"audio, sr = our_track.audio\n",
"\n",
"# Plotting waveform\n",
"pitch_frames = int(segment_in_seconds * sr * 0.01)\n",
"plot_pitch(\n",
" pitch=predicted_pitch[:pitch_frames, 1],\n",
" times=predicted_pitch[:pitch_frames, 0],\n",
");\n",
"\n",
"# Playing 10 seconds of audio used for prediction\n",
"audio_samples = int(segment_in_seconds * sr)\n",
"audio_short = audio[:, :audio_samples]\n",
"ipd.Audio(\n",
" data=audio_short,\n",
" rate=sr\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from compiam.visualisation.pitch import plot_pitch\n",
"\n",
"# Plotting waveform\n",
"pitch_frames = int(segment_in_seconds * sr * 0.01) ## 0.01 is the chosen step\n",
"pitch_values = predicted_pitch[:pitch_frames, 1]\n",
"pitch_values[pitch_values < 20] = None\n",
"pitch_frames = int(segment_in_seconds * ftanet_carnatic.sample_rate * 0.01)\n",
"plot_pitch(\n",
" pitch=predicted_pitch[:pitch_frames, 1],\n",
" times=predicted_pitch[:pitch_frames, 0],\n",
Expand Down

0 comments on commit cd8f797

Please sign in to comment.