mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-09 15:39:08 +00:00
plot sbc buffer, expects file sbc-buffer.csv
This commit is contained in:
parent
13e71c7bf4
commit
eacb07ef8f
29
test/avdtp/plot_sbc_buffer.py
Executable file
29
test/avdtp/plot_sbc_buffer.py
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import csv
|
||||
|
||||
timestamp = list()
|
||||
storage = list()
|
||||
sbc_buffer_name = 'sbc_buffer.pdf'
|
||||
with open('sbc-buffer.csv', 'rb') as csvfile:
|
||||
data = csv.reader(csvfile, delimiter=' ')
|
||||
for row in data:
|
||||
i = 0
|
||||
for cell in row:
|
||||
if i == 0:
|
||||
timestamp.append(int(cell))
|
||||
i = 1
|
||||
elif i == 1:
|
||||
storage.append(int(cell))
|
||||
i = 2
|
||||
|
||||
t = len(timestamp)
|
||||
|
||||
plt.plot(timestamp[0:t], storage[0:t], '.')
|
||||
plt.xlabel('Time [ms]')
|
||||
plt.ylabel('Queued SBC frames')
|
||||
#plt.show()
|
||||
plt.savefig(sbc_buffer_name)
|
||||
|
||||
print("\nCreated figure \'%s\', audio duration %d seconds.\n" % (sbc_buffer_name, len(timestamp)/1000))
|
Loading…
Reference in New Issue
Block a user