One of very nice fatures in the LTSpice (whichj unfortunately is not open source) is the possibility to read signals from audio files and to write signals to audio files ( http://electrostud.wikia.com/wiki/Using_WAVE_files_as_input/output_in_LTSpice ).
I think, that similar feature could be also very useful in QUCS (e.g. sometimes I use it to demonstrate operation of audio processing circuits for my students).
I've prepared some data converter for QUCS:
QUCS-> Python http://groups.google.com/group/alt.sources/browse_thread/thread/e2f3007b60c02af7
QUCS->Octave -> http://groups.google.com/group/alt.sources/browse_thread/thread/256dd5ee7e365db0
Octave->Qucs -> http://groups.google.com/group/alt.sources/browse_thread/thread/7775fc3c9cb4ad3b
However even though the above converters allow to convert audio file into QUCS data and then to convert results back to audio
format, it is very inconvenient to do it with external programs...
It would be very good to have possibility to have e.g. voltage source for transient analysis with values read as samples from WAV or FLAC file (of course with possibility to interpolate values between the sampling moments).
Similarly it should be possible to store results of simulation into the WAV or FLAC file with defined resolution and sampling frequency.
This shouldn't be too hard to do for someone who knows Yacc and how the WAV and FLAC formats are (the WAV format is pretty simple; I don't know about FLAC).
If you have a look at
qucs-core/src/components/vfile.cpp(and ifile.cpp), you can see these lines:so it would be a matter of adding something like
and then modifying
qucs-core/src/dataset.cppto adddataset::load_wav()anddataset::load_flac()methods.Right now all file parsers use Yacc, which I have no idea how to use, nor what files should be created and modified (
parse_wav.yandparse_flac.y, and don't know if some makefiles or scripts). Another solution would be to ignore the Yacc part and write a function that directly does all the parsing work, but this might not be a good idea since it's not how the rest of Qucs seems to be.Last edit: Cousteau 2013-06-27
I think it is easy to implement this using an octave script.