Changeset 77671b4


Ignore:
Timestamp:
Sep 4, 2005, 5:49:08 PM (19 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
bfe76d4
Parents:
3c86eb1
Message:

add plotting of truth file for pitch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/gnuplot.py

    r3c86eb1 r77671b4  
    242242        for i in range(len(pitch)):
    243243                downtime = (hopsize/samplerate)*numarray.arange(len(pitch[i]))
    244                 d.append(Gnuplot.Data(downtime,pitch[i],with='lines'))
     244                d.append(Gnuplot.Data(downtime,pitch[i],with='lines',
     245                        title=('%d' % i)))
    245246                maxpitch = max(maxpitch,max(pitch[i][:])*1.1)
    246247
     
    252253        else:
    253254                title = "truth file plotting not implemented yet"
    254                 t = Gnuplot.Data(0,0,with='impulses')
    255                 #times,pitch = aubio.txtfile.read_datafile(datafile)
    256                 #t = Gnuplot.Data(times,pitch,with='lines')
     255                values = aubio.txtfile.read_datafile(datafile)
     256                time, pitch = [], []
     257                for i in range(len(values)):
     258                        time.append(values[i][0])
     259                        pitch.append(values[i][1])
     260                d.append(Gnuplot.Data(time,pitch,with='lines',title='ground truth'))
    257261               
    258262                #orig, missed, merged, expc, bad, doubled = \
     
    301305        g('set xrange [0:%f]' % max(time))
    302306        g('set yrange [40:%f]' % maxpitch)
     307        g('set key right top')
    303308        g.xlabel('time')
    304309        g.ylabel('frequency (Hz)')
Note: See TracChangeset for help on using the changeset viewer.