Operator precedence, value assignment, arrays, and things not working as expected.... » Hall of Fame » FORUM lowesmall.shop
FORUM lowesmall.shop

FORUM lowesmall.shop



ПоискПоиск   Users   Registration   Entrance
Today: 15.03.2025 - 07:15:41
Pages:  1  

Operator precedence, value assignment, arrays, and things not working as expected....

Advertising


AuthorMessage

///Mike S54

main user




Statistics:
Messages: 40
Registration: 04.18.2002

Hello all, I have plenty of software development and DSP experience, but I feel like I'm missing something in JS. I'm trying to implement some filters(Biquad and State Variable), that I've had working on other platforms for years, I've even verified that the exact same coefficients are being generated at every filter tap vs my other working versions, but at the actual filter, it's exploding numerically. I've been creating assignment variables for the filter taps, for example: Nm2=Nm1; //n-2 Nm1=spl0; //n-1 //filter code spl0 = (b0*spl0)+(Nm1*b1)+ yada, yada.... //output taps Np2=Np1; Np1=spl0; I'm really not sure what's going wrong, the cutoff frequency is not above or below the min/max stable value for the filter, my best guess is that the value assignments aren't happening how I expect them to, or maybe the lines of code pertaining to assignment are run sequentially like a script... Anyways, I would really appreciate if anybody has any suggestions. Also, can anybody explain arrays in JS? Do I need to declare an array size, the JS guide doesn't really go into depth. Like C# stylee: int[] array = new int[5]; I was trying to create a simple un-interpolated delay line, but it wasn't working.

---------------------
2001 M Roadster
Message # 1 14.01.24 - 22:21:27
RE: Operator precedence, value assignment, arrays, and things not working as expected....

BMTHREE

main user




Statistics:
Messages: 230
Registration: 05.15.2003

Hi, speaking of dealing with arrays this thread might be worth mentioning.

---------------------
Message # 2 14.01.24 - 22:33:01
RE: Operator precedence, value assignment, arrays, and things not working as expected....

Pro-Imports

main user




Statistics:
Messages: 214
Registration: 04.16.2003

I got it working, AFAIK, it had to do with precedence, despite my gratuitous use of parentheses(not really sure why it works now but not then), but atleast it works. Now I have to troubleshoot a DC offset @ < 100hz issue, which can't be too hard. Thanks again.

---------------------
Message # 3 14.01.24 - 22:38:59
RE: Operator precedence, value assignment, arrays, and things not working as expected....

s2kpunisher

main user




Statistics:
Messages: 554
Registration: 09.20.2002

OK, confirmed a bug in the way floating point is processed, will report in the bug forum...

---------------------
Message # 4 14.01.24 - 22:46:04
RE: Operator precedence, value assignment, arrays, and things not working as expected....

94-325i

main user




Statistics:
Messages: 822
Registration: 11.08.2002

Ummmm... Decided to play with it some more, the FP bug may not be as much of an issue as I thought(or it may not actually be a production bug, but a monitoring bug), and I have the filter working using the JS plugin array memory where a loop such as: @sample i=0; loop(poles*.5, spl0=filter calculations referencing buffer[i*blah+blah] i=i+1; //wishlist: the ability to type increment as i++; ); And it works just fine and stable, and the frequency response is substantially what I would expect at a given order, BUT... the CPU useage is ridiculous, I could set it to 100poles in theory, but in reality, my modern top-notch computer craps out at about 10poles(176.4k SR), displaying 20% cpu useage in the channel FX window for that plugin(on a channel with Reasynth in an otherwise empty project). I'm guessing there's some really poor memory management going on there in the arrays(calls to main memory instead of the CPU caching the <500 bytes of array data actually in use).

---------------------
Message # 5 14.01.24 - 22:57:37
RE: Operator precedence, value assignment, arrays, and things not working as expected....

Sammyzuko

main user




Statistics:
Messages: 2,933
Registration: 11.15.2003

Hi Dub3000, Everything is recipricolated(tm), so there is no division going on in @sample, and very little in @slider. I've minimized unnecessary Flops in the @sampleblock as much as possible. It's not 10x oversampled, it's 10 poles, or a 5* 2pole cascade(the combobox control goes up to 16poles, but that ain't happening). As far as denormals, what's the best way to go about fixing it in JS? I'd thought of this, but adding a smallish number to the unit delays didn't seem to help much(granted, I could experiment more). Any tips other than adding a tiny dc offset?

---------------------
Message # 6 14.01.24 - 23:07:26
RE: Operator precedence, value assignment, arrays, and things not working as expected....

J.Snow

main user




Statistics:
Messages: 425
Registration: 11.05.2003

I replaced the iterative pole adding version with an identical one without the loop(still using []), and CPU useage was the same for a single 2pole section(scaling linearly with CPU useage). I replaced buffer[0...7] with 8 declared variables, and CPU went from 6% to 1% for a single 2 pole stereo filter at 176400hz. Note to self: Don't use arrays in the @sample block. Ever. ;) :P

---------------------
98 323is-conforti intake-MZ3 short shifter-17" staggered Breyton Inspirations-JL 10w7 and 500.1 amp.
Message # 7 14.01.24 - 23:18:55
RE: Operator precedence, value assignment, arrays, and things not working as expected....

lancerr

main user




Statistics:
Messages: 228
Registration: 10.10.2001

cool, good to hear. just out of interest, how come you're working at 176kHz?

---------------------
Message # 8 14.01.24 - 23:25:46
RE: Operator precedence, value assignment, arrays, and things not working as expected....
Can you run more than 1 Digi 001? : Previous topicNext topic: Dual Audio .avi -> SVCD.
Pages:  1  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants