tlecomte / friture Goto Github PK
View Code? Open in Web Editor NEWReal-time audio visualizations (spectrum, spectrogram, etc.)
Home Page: http://friture.org
License: GNU General Public License v3.0
Real-time audio visualizations (spectrum, spectrogram, etc.)
Home Page: http://friture.org
License: GNU General Public License v3.0
The level labels should be updated more slowly, they can't be read right now !
Friture has a home-made logging facility, that works nicely but could be more powerful if implemented using the python logging facility (timestamps, etc.)
Histogram-like plots are slow when there is a lot of boxes to display, even when caching pixmaps. That's because numpy arrays and histograms are not well integrated in PyQwt, so that we have to explicitely loop over array elements and call something like drawPixmap or fillRect for each one.
I investigated using Cython to integrate Qt and numpy arrays on those operations, but the gain is marginal since Python operations keep being involved. (source = http://groups.google.com/group/cython-users/browse_thread/thread/458ac77fcb5396b5/94bf579351a54933?lnk=gst&q=qt#94bf579351a54933)
Instead, PyOpenGL is well integrated with numpy arrays, and allows to use fast OpenGL calls. Early test show a huge performance gain with that approach, which needs to be completed.
Dependencies are not listed in the install_requires of setup.py so users of PyPI have to figure out the dependencies by themselves...
On Linux, there is an unwanted delay (a few ms to a couple of seconds) between audio input and display.
This seems related to Pulseaudio:
http://forum.skype.com/index.php?s=7609fb1fac9ee65573e0ceb92562c481&showtopic=237601&st=0&p=1059071&#entry1059071
https://bugzilla.redhat.com/show_bug.cgi?id=444388
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/4537
Title says it all.
Everytime I change the size of the main window, the 2D spectrogram will black out and restart, thereby not displaying data from the previous x seconds.
friture script, which is used on OS X and Linux, has DOS line endings instead of Unix. Cannot be launched on OS X at least.
The fractional octave filters output is squared and heavily low-passed (from 25 ms to 1s response time, sampled at 25 ms), so the decimation factor is of the order of 1000.
Consequently, we can use a polyphase filter for the low-pass part, but by propagating the decimation, we can also do use a polyphase fractional octave filte. This will bring a huge performance enhancement (several times a factor of 1000), and is compatible with any kind of fractional octave filter shape !
Currently the octave spectrum uses IIR filters with decimation to go from one octave to the next. It would be smarter to use FIR instead of IIR filters, since they are more stable to numeric issues, and these FIR filters could be implemented with an overlap-add FFT algorithm for efficiency (keeping the decimation or not, depends on complexity - to be examined).
We need to investigate the way to distribute Friture on MacOS, especially as far as dependencies are concerned (involves py2app). On Windows, this has been achieved using py2exe and NSIS to provide an installer.
PyInstaller should be used instead of py2exe. It has the following advantages:
It has the following drawbacks:
Friture should use polyphase decimators for efficiency, instead of the standard filters used currently.
See : http://www.scribd.com/doc/50517099/8/Polyphase-Decimator
Users have currently no way to know what version they are running. I need to provide a widget somewhere in the about page with the version number and the version date.
Currently, high-order IIR filters are used for decimation and fractional octave filters, and they are implemented as brute-force filtering, whereas it is advised to use series of biquads to achieve more stability (the use of floats instead of integers mitigates the issue).
psutil is currently a hard dependency, which is mostly fine, but is an issue when running Friture for Windows under Linux with Wine, so the import could be nested in try ... except ... so that it is optional.
Hi,
I'm on Mac OSX yosemite. I just finished installing all the dependencies and friture as outlined on your mac guidelines page! I really want to be able to use friture, but I have no idea of what are the possible commands and things I can do with it. I've tried looking up the project page and the github page. Could you please direct me to the documentation, and IF possible, some examples? It would surely be very helpful :)
IEC specification for pink noise, and building strategy for a -3dB/octave filter :
http://sound.westhost.com/project11.htm
Reported by @acousticolor in #42:
As promised, after some testing these days, some feedback on the new OSX version 18.0.16.
Indeed it did install, and created a executeable Friture.
I suppose it is the work of QT, but there are some quirks with Friture when:
Any advice or guidence for me to help you out with the correct debug information?
Sincerely,
Marcel Wardenier ing.
(From private mail)
Friture 0.18 (and previous versions, based on your website screen shots) only has the 'even' division lines showing in “Logarithmic” Frequency scale for the FFT Spectrum. For example, the frequency division lines for 3000, 5000, 7000 and 9000 Hz are not shown on the Frequency scale when it’s set to “Logarithmic” mode. However, all of the graph’s division lines are present when set to “Linear” mode.
It’s not a big problem, but it can be a bit misleading. I have never noticed it, until today. I was looking at an area in spectrum and thinking it was around 3 kHz (the 2nd line over from 1 kHz), then I noticed that the cross-hair cursors actually read something closer to 4 kHz. I moved the cursor to other locations and that’s when I realized that the all of the ‘odd’ division lines were missing from the Logarithmic graph.
The device info from portaudio reports a low input latency (max 46 ms), but after opening the stream, it is reported to be 139 ms. Why ?
Look at Jack and Soundflower for ideas on how to do this. Warning : seems to be hacky !
http://stackoverflow.com/questions/1133142/hal-how-to-monitor-audio-output-on-a-mac
In the current code, the octave and fractional-octave filters are implemented with a cascade of decimations and a set of bandpass filters for each octave, but only the low-pass signal is decimated. According to the nyquist theorem, the high frequency parts can also be high-pass filtered and decimated before the octave filters are applied. Quadrature mirror filters allow to do both the low-pass and high-pass decimation with one filter only. So the expected performance should be twice as high as the current implementation.
Hello, after a couple of smaller issues I was successful to install and run friture on my OpenSuse 13.2 system right now. Unfortunately on starting I got an error message and just could abort the program.
I'm using Qt5 right now, and hope everything is well installed.
After I installed everything I had a "setup build" and "setup install" running as sudo. Then I started the friture script from /usr/bin as normal user from the console. In the background I see the friture main window. This disappears when I press the Abort button, what is the only chance to close the error dialog. Starting as sudo did not solve the problem, but gives an other failire "QXcbConnection : Could not connect to display".
Unfortunately I'm not to familiar with python and qt programming to find out more, and it seems there's also nothing on the web searching for some of the keywords.
If there's information I can forward please let me know.
Thanks a lot for your help!
//hufnala
<class 'OSError'>:
File "/usr/lib64/python3.4/site-packages/friture-0.19-py3.4-linux-x86_64.egg/friture/plotting/canvasWidget.py", line 67, in paintEvent
self.drawData(painter)
File "/usr/lib64/python3.4/site-packages/friture-0.19-py3.4-linux-x86_64.egg/friture/plotting/canvasWidget.py", line 98, in drawData
item.draw(painter, self.horizontalScaleTransform, self.verticalScaleTransform, self.rect())
File "/usr/lib64/python3.4/site-packages/friture-0.19-py3.4-linux-x86_64.egg/friture/imageplot.py", line 120, in draw
time = self.audiobackend.get_stream_time()
File "/usr/lib64/python3.4/site-packages/friture-0.19-py3.4-linux-x86_64.egg/friture/audiobackend.py", line 384, in get_stream_time
return self.stream.get_time()
File "/usr/lib64/python3.4/site-packages/pyaudio.py", line 488, in get_time
return pa.get_stream_time(self._stream)
Friture 0.19.0.0
To measure the resonance decay time in a room, we need a graph showing levels on a long time scale.
Performance : when there is no input, audio data goes to 0., and log spectrum goes to -Inf, which seems to slow down computations enormously.
Hello.
During the launch I got this error:
2016-11-20, 19:42:00
--------------------------------------------------------------------------------
<class 'sounddevice.PortAudioError'>:
Error getting stream time
--------------------------------------------------------------------------------
File "./friture/plotting/canvasWidget.py", line 67, in paintEvent
self.drawData(painter)
File "./friture/plotting/canvasWidget.py", line 98, in drawData
item.draw(painter, self.horizontalScaleTransform, self.verticalScaleTransform, self.rect())
File "./friture/imageplot.py", line 120, in draw
time = self.audiobackend.get_stream_time()
File "./friture/audiobackend.py", line 391, in get_stream_time
return self.stream.time
File "/home/alex/environments/sonic/lib/python3.5/site-packages/sounddevice.py", line 1069, in time
raise PortAudioError('Error getting stream time')
--------------------------------------------------------------------------------
Friture 0.20.0.0
System information:
$ uname -a
Linux bender 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux
$ pip list
cffi (1.9.1)
Cython (0.25.1)
docutils (0.12)
numpy (1.11.2)
pip (9.0.1)
psutil (5.0.0)
pycparser (2.17)
PyOpenGL (3.1.0)
PyOpenGL-accelerate (3.1.0)
PyQt5 (5.7)
scipy (0.18.1)
setuptools (28.8.0)
sip (4.18.1)
sounddevice (0.3.5)
wheel (0.30.0a0)
$python --version
Python 3.5.2
On a fast computer, the application lauches so fast that I can't even read the word Friture !! Need a one second timer...
This can be either ignored or aborted. Ignoring causes popup to reappear every time.
<class 'OSError'>:
File "/usr/lib/python3/dist-packages/friture/plotting/canvasWidget.py", line 67, in paintEvent
self.drawData(painter)
File "/usr/lib/python3/dist-packages/friture/plotting/canvasWidget.py", line 98, in drawData
item.draw(painter, self.horizontalScaleTransform, self.verticalScaleTransform, self.rect())
File "/usr/lib/python3/dist-packages/friture/imageplot.py", line 120, in draw
time = self.audiobackend.get_stream_time()
File "/usr/lib/python3/dist-packages/friture/audiobackend.py", line 384, in get_stream_time
return self.stream.get_time()
File "/usr/lib/python3/dist-packages/pyaudio.py", line 489, in get_time
return pa.get_stream_time(self._stream)
Friture 0.19.0.0
OS: Linux Mint 18 Sarah
Version: 0.19.0.8-1~getdeb1
Investigate the use of Numexpr to speed up some Numpy expressions (I think of abs() and log10() for example).
Hi, Friture is amazing application, thakns for build!
I am just missing some converter to note, like 220Hz means A3 and so on.
Would be very usefull, thank you :)
The 2D spectrogram has issues with the painting time accuracy. This is mostly noticeable with generated signals, such as an exponential sweep.
It may be related to :
http://www.qtcentre.org/threads/40317-frame-rate-and-QTimer-accuracy?s=2b3923a7c9c9fcbb01cc8eb9260c0012
http://www.qtcentre.org/threads/23167-How-can-I-get-a-30-or-60-frame-rate-when-using-QGLWidget-QTimer-is-not-acurate
http://www.folding-hyperspace.com/program_tip_14.htm
Currently the generator keeps producing signal even when closed !!
The main site's download section doesnot list the updated binaries
As mac os x related issue was solved in issue 42, it would be better to update it on the site too.
Windows 7
Using the latest public build.
This is what I notice in the error log.
Traceback (most recent call last):
File "friture.py", line 7, in
File "friture\analyzer.pyc", line 28, in
File "friture\audiobuffer.pyc", line 20, in
File "friture\ringbuffer.pyc", line 24, in
File "numpy__init__.pyc", line 153, in
File "numpy\add_newdocs.pyc", line 13, in
File "numpy\lib__init__.pyc", line 18, in
File "numpy\lib\polynomial.pyc", line 19, in
File "numpy\linalg__init__.pyc", line 50, in
File "numpy\linalg\linalg.pyc", line 29, in
File "numpy\linalg\lapack_lite.pyc", line 12, in
File "numpy\linalg\lapack_lite.pyc", line 10, in load
ImportError: DLL load failed: The specified module could not be found.
Traceback (most recent call last):
File "friture.py", line 7, in
File "friture\analyzer.pyc", line 28, in
File "friture\audiobuffer.pyc", line 20, in
File "friture\ringbuffer.pyc", line 24, in
File "numpy__init.pyc", line 153, in
File "numpy\add_newdocs.pyc", line 13, in
File "numpy\lib__init__.pyc", line 18, in
File "numpy\lib\polynomial.pyc", line 19, in
File "numpy\linalg__init__.pyc", line 50, in
File "numpy\linalg\linalg.pyc", line 29, in
File "numpy\linalg\lapack_lite.pyc", line 12, in
File "numpy\linalg\lapack_lite.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
Hi. An rta in python is what I want, and you did it! Thank you for this tool. I really like the extensibility to add dock features.
I see you've gotten the later releases to run on Windows. A commendable feat. Is there any interest is running on mobile phones? I could use these tools in a portable way. Thanks.
Publish announcements for audio related communities (PyQwt: done).
Rainbow colormap is generally not recommended due to being misleading. A choice of colormaps that monotonically increase in brightness would be better, like grayscale, thermal, YlGnBu_r, etc.
A choice of colormaps that monotonically increase in brightness would be better, like grayscale, thermal, YlGnBu_r, etc.
The display timer period is currently fixed to 25 ms. It should probably be made adaptative to handle various CPU loads and power.
SVG icons seem to be broken on Windows for all computers apart from mine !
I shall investigate whether a dll is missing or something like that.
It would be interesting to have STI (Speech Transmission Index) estimation integrated in Friture (among other speech quality estimators).
We probably want sys.version
here, or platform.python_version()
Performance: on Linux (at least), there is an unsatisfying large CPU usage coming from python and Xorg to be investigated.
Continuous wavelet transform seems like an interesting alternative to STFT for time/frequency analysis.
See : http://www.phy.uct.ac.za/courses/python/examples/moreexamples.html#wavelet-analysis-continuous-wavelet-transform
See also : http://kelvinchufei.blogspot.com/2008/01/wavelet-scalogram-using-complex-morlet.html
Although the instructions are here, it lacks a clear set of commands to compile the extensions and run Friture from the command line.
I am trying to install Friture on Raspbian 3.18, and I keep getting problems with the norm_square file when I try to run the program. At first, it couldn't find norm_square, so I moved it down a directory. It still couldn't find it, so I changed the extension from .pyx to .py (I'm sure this was a stupid idea, but at least it found the file).
Now it keeps finding syntax errors. I commented out the errors, and it just found more. Here are a few that it's having trouble with:
cimport numpy as np
ctypedef np.float_64_t dtype_t
def pyx_norm_square(np.ndarray[np.complex128_t, ndim=1] fft not None, np.float64_t factor):
Any idea what the problem might be?
Windows 7, friture-0.18-20150824 (friture-0.18-20150909 does not work at all) If I try to adjust the FFT spectrum range or ear weighting, it crashes. How do I get the Python traceback to display when this happens? There is a friture.exe.log but it's empty.
To implement a "stricly-correct" spectrogram with correct STFT sampling/resampling, I need precise timing information: the time associated with the buffer obtained from stream.read, and the current time (the GUI time). The first one is not available in the blocking mode of PortAudio, but only in the callback mode (see PaStreamCallbackTimeInfo). Unfortunately PyAudio only binds the blocking mode of PortAudio. Fastaudio is a binding for the non-blocking mode, but uses the V18 API which does not provides PaStreamCallbackTimeInfo.
https://github.com/bastibe/PyAudio seems to provide what I need !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.