Mercurial > hg > mirex2013
changeset 57:e4d2a92fbcf4
Cepstral pitch tracker didn't do very well, we know enough about it now!
author | Chris Cannam |
---|---|
date | Thu, 04 Sep 2014 13:59:00 +0100 |
parents | 674fb672aa76 |
children | 254229761896 |
files | audio_melody_extraction/cepstral-pitchtracker/README.txt audio_melody_extraction/cepstral-pitchtracker/ame_cep.sh audio_melody_extraction/cepstral-pitchtracker/ame_cep.ttl audio_melody_extraction/cepstral-pitchtracker/cepstral-pitchtracker.n3 audio_melody_extraction/cepstral-pitchtracker/cepstral-pitchtracker.so |
diffstat | 5 files changed, 0 insertions(+), 208 deletions(-) [+] |
line wrap: on
line diff
--- a/audio_melody_extraction/cepstral-pitchtracker/README.txt Wed Sep 03 14:18:23 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -# MIREX 2013 submission -# -# Audio Melody Extraction -# Chris Cannam, chris.cannam@eecs.qmul.ac.uk - -# Architecture - -- Linux 64-bit - -# Dependencies - -- Sonic Annotator v1.0 - http://code.soundsoftware.ac.uk/projects/sonic-annotator/files - -- Typical Unix/GNU shell commands - -# How to run - -In a terminal window run: - -./ame_cep.sh input.wav output.txt -
--- a/audio_melody_extraction/cepstral-pitchtracker/ame_cep.sh Wed Sep 03 14:18:23 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -#!/bin/sh - -mydir=`dirname "$0"` -infile="$1" -outfile="$2" - -if [ t"$infile" = "t" ] || [ t"$outfile" = "t" ]; then - echo "Usage: $0 infile.wav outfile.txt" - exit 2 -fi - -mkdir -p "$mydir"/out || exit 1 - -inbase=`basename "$infile"` -inbase=${inbase%.*} -suffix="vamp_cepstral-pitchtracker_cepstral-pitchtracker" - -echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 - -# Run the cepstral pitch tracker plugin. We obtain two outputs, the -# voiced f0 and the raw peak frequencies (without regard to voicing -# segmentation). From this we need to produce a single output which -# has a f0 estimate for each 10ms step, with the unvoiced estimates -# having negative values. -# -# So we use the "fill" option of the pitch tracker to get continuous -# f0 estimates within each voiced note, and then we need to draw the -# f0 estimates from the raw file (made negative) except where there is -# also an estimate in the f0 file (in which case we use that). - -# 1. Run the tracker. This will produce output files -# out/${infile}_${suffix}_f0.csv and out/${infile}_${suffix}_raw.csv - -VAMP_PATH="$mydir" sonic-annotator \ - -t "$mydir"/ame_cep.ttl \ - -w csv --csv-separator ';' \ - --csv-basedir "$mydir/out" \ - --csv-force \ - "$infile" || exit 1 - -# 2. Check the output files exist - -f0file="out/${inbase}_${suffix}_f0.csv" -if [ ! -f "$f0file" ]; then - echo "f0 output file $f0file not found! bailing out"; exit 1 -fi - -rawfile="out/${inbase}_${suffix}_raw.csv" -if [ ! -f "$rawfile" ]; then - echo "raw output file $rawfile not found! bailing out"; exit 1 -fi - -# 3. Postprocess to get the f0 estimates where they exist and the -# negative raw peaks elsewhere. This breaks down as - -# - list all timestamps in both files, in time order; -# - extract those that appear only once: these are the unvoiced times; -# - obtain lines with those timestamps from the raw file and make their -# values negative (the sed command); -# - merge with the voiced times from the f0 file; -# - sort and replace comma separator with tab. - -cat "$f0file" "$rawfile" | awk -F';' '{ print $1; }' | sort -n | \ - uniq -u | \ - cat - "$rawfile" | sort -n | \ - sed -n -e '/^[^;]*$/b a' -e d -e :a -e n -e 's/;/;-/' -e p | \ - cat - "$f0file" | \ - sed 's/;/\t/' | \ - sort -n > "$outfile" || exit 1 - -grep -v - "$outfile" | wc -l | awk '{ print $1 " voiced"; }' -grep - "$outfile" | wc -l | awk '{ print $1 " unvoiced"; }' - -echo "Done, output is in $outfile"
--- a/audio_melody_extraction/cepstral-pitchtracker/ame_cep.ttl Wed Sep 03 14:18:23 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix vamp: <http://purl.org/ontology/vamp/> . -@prefix cep: <http://vamp-plugins.org/rdf/plugins/cepstral-pitchtracker#> . -@prefix : <#> . - -:transform_f0 a vamp:Transform ; - vamp:plugin cep:cepstral-pitchtracker ; - vamp:step_size "441"^^xsd:int ; - vamp:block_size "1024"^^xsd:int ; - vamp:parameter_binding [ - vamp:parameter [ vamp:identifier "sensitivity" ] ; - vamp:value "15"^^xsd:float ; - ] ; - vamp:parameter_binding [ - vamp:parameter [ vamp:identifier "slack" ] ; - vamp:value "40"^^xsd:float ; - ] ; - vamp:parameter_binding [ - vamp:parameter [ vamp:identifier "threshold" ] ; - vamp:value "0.1"^^xsd:float ; - ] ; - vamp:parameter_binding [ - vamp:parameter [ vamp:identifier "fill" ] ; - vamp:value "1"^^xsd:float ; - ] ; - vamp:output cep:cepstral-pitchtracker_output_f0 . - -:transform_raw a vamp:Transform ; - vamp:plugin cep:cepstral-pitchtracker ; - vamp:step_size "441"^^xsd:int ; - vamp:block_size "1024"^^xsd:int ; - vamp:output cep:cepstral-pitchtracker_output_raw . -
--- a/audio_melody_extraction/cepstral-pitchtracker/cepstral-pitchtracker.n3 Wed Sep 03 14:18:23 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix vamp: <http://purl.org/ontology/vamp/> . -@prefix plugbase: <http://vamp-plugins.org/rdf/plugins/cepstral-pitchtracker#> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . -@prefix dc: <http://purl.org/dc/elements/1.1/> . -@prefix af: <http://purl.org/ontology/af/> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix cc: <http://web.resource.org/cc/> . -@prefix : <#> . - -<> a vamp:PluginDescription ; - foaf:maker <http://www.vamp-plugins.org/doap.rdf#template-generator> ; - foaf:primaryTopic <http://vamp-plugins.org/rdf/plugins/cepstral-pitchtracker> . - -:cepstral-pitchtracker a vamp:PluginLibrary ; - vamp:identifier "cepstral-pitchtracker" ; - vamp:available_plugin plugbase:cepstral-pitchtracker ; - foaf:page <http://code.soundsoftware.ac.uk/projects/cepstral-pitchtracker> ; - . - -plugbase:cepstral-pitchtracker a vamp:Plugin ; - dc:title "Cepstral Pitch Tracker" ; - vamp:name "Cepstral Pitch Tracker" ; - dc:description """Estimate f0 of monophonic material using a cepstrum method.""" ; - foaf:maker [ foaf:name "Chris Cannam" ] ; # FIXME could give plugin author's URI here - dc:rights """Freely redistributable (BSD license)""" ; -# cc:license <Place plugin license URI here and uncomment> ; - vamp:identifier "cepstral-pitchtracker" ; - vamp:vamp_API_version vamp:api_version_2 ; - owl:versionInfo "1" ; - vamp:input_domain vamp:FrequencyDomain ; - - vamp:output plugbase:cepstral-pitchtracker_output_f0 ; - vamp:output plugbase:cepstral-pitchtracker_output_notes ; - vamp:output plugbase:cepstral-pitchtracker_output_raw ; - . -plugbase:cepstral-pitchtracker_output_f0 a vamp:DenseOutput ; - vamp:identifier "f0" ; - dc:title "Estimated f0" ; - dc:description """Estimated fundamental frequency""" ; - vamp:fixed_bin_count "true" ; - vamp:unit "Hz" ; - a vamp:KnownExtentsOutput ; - vamp:min_value 50 ; - vamp:max_value 900 ; - vamp:bin_count 1 ; -# vamp:computes_event_type <Place event type URI here and uncomment> ; -# vamp:computes_feature <Place feature attribute URI here and uncomment> ; -# vamp:computes_signal_type <Place signal type URI here and uncomment> ; - . -plugbase:cepstral-pitchtracker_output_notes a vamp:DenseOutput ; - vamp:identifier "notes" ; - dc:title "Notes" ; - dc:description """Derived fixed-pitch note frequencies""" ; - vamp:fixed_bin_count "true" ; - vamp:unit "Hz" ; - a vamp:KnownExtentsOutput ; - vamp:min_value 50 ; - vamp:max_value 900 ; - vamp:bin_count 1 ; -# vamp:computes_event_type <Place event type URI here and uncomment> ; -# vamp:computes_feature <Place feature attribute URI here and uncomment> ; -# vamp:computes_signal_type <Place signal type URI here and uncomment> ; - . -plugbase:cepstral-pitchtracker_output_raw a vamp:DenseOutput ; - vamp:identifier "raw" ; - dc:title "Raw frequencies" ; - dc:description """Raw peak frequencies from cepstrum, including unvoiced segments""" ; - vamp:fixed_bin_count "true" ; - vamp:unit "Hz" ; - a vamp:KnownExtentsOutput ; - vamp:min_value 50 ; - vamp:max_value 900 ; - vamp:bin_count 1 ; -# vamp:computes_event_type <Place event type URI here and uncomment> ; -# vamp:computes_feature <Place feature attribute URI here and uncomment> ; -# vamp:computes_signal_type <Place signal type URI here and uncomment> ; - .