Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.
CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 11th April 2020, 11:46 AM   #341
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
I am not sure how to output samples in a standalone application. If you opt for another alsa device, it will duplicate the alsaloop functionality which does adaptive resampling too and you would code stuff not required by your project. I think a well-commented rust source code would itself be a major help.
  Reply With Quote
Old 11th April 2020, 12:44 PM   #342
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by phofman View Post
I am not sure how to output samples in a standalone application. If you opt for another alsa device, it will duplicate the alsaloop functionality which does adaptive resampling too and you would code stuff not required by your project. I think a well-commented rust source code would itself be a major help.
I will start simple, with reading and writing as raw binary. I can just copy the read/write code from "file" device in CamillaDSP. And I already have Python scripts for generating and analyzing the data.

It's recommended (almost mandatory) to include simple examples in Rust libraries. A raw in/out resampler is perfect for this.
Here is an example, a simple rust library I wrote for reading and writing tags in .ogg files: GitHub - HEnquist/lib-rust-oggvorbis-meta. In the "examples" folder you put one or several short programs that demonstrate how to use the library.
  Reply With Quote
Old 13th April 2020, 01:42 PM   #343
lykkedk is offline lykkedk  Denmark
diyAudio Member
 
lykkedk's Avatar
 
Join Date: Dec 2002
Location: Denmark, Fredericia
Hello here...

I'am (trying) to build some fir filters for this beautiful CamillaDSP engine, and while asking some quistions at this thread rePhase, a loudspeaker phase linearization, EQ and FIR filtering tool
At post #2984 i realised that i don't know about filter lengths and soo, seeing what fluid replied to me, maked me post this post now.

I hope i can have some explanation of what kind of filter to and what format i need (filter length's etc...)

## See attached picture too

I use REW and RePhase for the room correction.

Jesper.
Attached Images
File Type: png SAVE_Filters_2.png (16.5 KB, 207 views)
File Type: png SAVE_Filters_1.png (80.0 KB, 204 views)
__________________
DCG3 Dual DCSTB, AK4490 Dual SuperDAC
AlephJ Mimi! http://www.diyaudio.com/forums/pass-...mimi-mini.html. Github https://github.com/Lykkedk/SuperPlayer
  Reply With Quote
Old 13th April 2020, 03:04 PM   #344
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
It's not really possible to answer how long your filters should be, that really only depends on what you want to achieve!


But one can say a few things. Long filters are mostly useful for correcting low frequencies. Then it's not the length of the impulse response in samples that's important, but the length in time. So the filter at 96kHz should be twice as long (in samples or taps) as the one for 48 kHz to give the same result.



About format. Text is fine and have the advantage that it's human readble, but is slower to import and the files get quite big. I would recommend 64-bit floats (often called "double") if you are running 64-bit (the default), or 32-bit floats ("single" or sometimes "float") if you compiled CamillaDSP for 32-bit mode. Then there is no conversion needed when reading.
  Reply With Quote
Old 14th April 2020, 06:27 AM   #345
Daihedz is offline Daihedz  Switzerland
diyAudio Member
 
Join Date: Jan 2010
Quote:
Originally Posted by HenrikEnquist View Post
...when the source and sink are using different clock sources. ...
It' useful not only for In-Out:
Think of an X-Over, e.g. with 4 ways, each feeding a different 2-Channel DAC. If every of these 4 ways has his own resampler to catch up for the 4 different clocks of the DAC, then no more need to sychronzie these devices. This would be a very nice option, e.g. also in case you are scaling up a system by including some channels later on (a subwoofer p.ex.).
So in terms of camilladsp a high-quality SRC filter would indeed be a super option and something unseen until now.
  Reply With Quote
Old 14th April 2020, 07:12 AM   #346
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
I am not sure about performance when two unsynchronized DACs were used for multichannel. While adaptive resampling avoids buffer under/overflows (serial mode), it would not maintain interchannel frames synchronization in parallel mode, only in long run.
  Reply With Quote
Old 14th April 2020, 11:00 AM   #347
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Outputting to several independent dacs is probably never going to work well for a crossover. If we cross over at 2kHz and run 44100Hz, that means each single sample we are off adds a phase difference of 16 degrees. And I think it would be already be a challenge to make sure they stay within maybe +-100 samples.



I'm planning to put the resampling on the capture side. That means for let's say a stereo 2-way crossover only two channels need to resampled. It the resampling was at the playback side, that would instead be four and use twice the cpu time.
  Reply With Quote
Old 14th April 2020, 08:48 PM   #348
Daihedz is offline Daihedz  Switzerland
diyAudio Member
 
Join Date: Jan 2010
Some testing along with CamillaDSP:

I convolved a synthetic and quite weird test signal of 65 samples length along with five different LinPhase (128k) 4-way xovers of same xfrequencies (70/420/2450), but of different types from shallow to very steep (and ringing): (L)BES2, LR4, NT2, UBPol5_2 and HK. Just to have a look how it sums up after splitting the CamillaDSP data pipe into to 2x4 channels at the begin of the pipe, inserting the filters like for a real stereo xover, but then merging everything together again at the end of the pipe. Theoretically this equals ideally an 1:1 transmission (along with some processor heating). The idea was to control wheter there is a critical filter type, where the convolving process would introduce some glitches for one reason or another. Result: Nope! Perfect convolution/summation with all types of xovers!

Time.png

Time_Zoom.png

Red is the original MinPhase test signal, artificially delayed by 65532 samples for the foto session. The other curves are the result of the 4-way-convolution after summation. They have been artificially delayed 2-sample-wise to better show theirs congruence with the original test signal.

Conclusion: Convolution does not harm and is ok with any filter type - as hopefully expected!
Attached Images
File Type: png Time.png (9.8 KB, 142 views)
File Type: png Time_Zoom.png (50.6 KB, 144 views)
  Reply With Quote
Old 15th April 2020, 08:55 PM   #349
Daihedz is offline Daihedz  Switzerland
diyAudio Member
 
Join Date: Jan 2010
Brief Addon:
While convolution does not distort the test pulse used in the above test set, sample rate conversion (SRC) does. Same 2x4xover setup as before with 3 sets of LR4 filters (44.1/88.2/96), same input file 44.1/16. SRC was performed with 64Bit accuracy by resample_soxr --band-width 80 --phase 25. The convolver was CamillaDSP - what else?

I_Time.png

The graph shows the 3 output impulses after summing 4 channels xover. Green 44.1k -> 44.1k (no resampling), 44.1k -> 88.2k (brown), 44.1k -> 96k (blue). Brown and blue are more or less the same, so there is absolutely no point in beleiving in even and integer resampling ratios such as is advocated by some.

So now it gets interesting. How will (maybe) the new and upcoming resampler algorithm behave with this synthetic, really nasty input signal? My bet is that any resampler will fail with this test, because of the nature of this "ugly" and quasi transient input signal.
Attached Images
File Type: png I_Time.png (27.3 KB, 127 views)
  Reply With Quote
Old 15th April 2020, 09:14 PM   #350
Tfive is offline Tfive  Germany
diyAudio Member
 
Tfive's Avatar
 
Join Date: Jun 2018
Location: Straubing
I'll comment on this with my admittedly incomplete knowledge about the sampling theorem...

IMHO the input signal you gave is not allowed - or to rephrase slightly - it could never have come from digitizing an analogue signal as it would have had to contain frequency components above the nyquist frequency. This violates the sampling theorem, you can't sample frequencies above nyquist.

So my theory is that the resampler is excited by this transient and shows ringing in it's filter with these "unallowed" frequency components.

Hopefully somebody with better knowledge about this stuff can comment on this.
__________________
Want more of the good stuff? -> https://t-5.eu/
  Reply With Quote

Reply


CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The room correction or speaker correction? What can we do with dsp power now availabl Raimonds Full Range 233 28th January 2017 07:51 AM
Introducing OpenDRC, Open Digital Room Correction engine minidsp miniDSP 20 20th January 2016 05:37 PM
What the difference between dsp room correction eq and software correction erez1012 PC Based 0 10th March 2014 07:07 PM
Writing a Cross-Platform, Free Software Modeling Tool and TS-Parameter DB justinzane Software Tools 6 31st December 2013 06:55 AM
FS: DAC, room-correction, active crossovers, amp, speakers! taloyd Swap Meet 4 14th April 2009 03:16 PM


New To Site? Need Help?

All times are GMT. The time now is 04:00 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio
Wiki