DSP Code: Why Can't I Multiply a Streamin?
Posted: Wed Apr 17, 2013 10:38 pm
So I was putting together a bit of DSP code, and everything was working perfectly, but I realized that my code took an input range of 0-2 and I thought it might be nice to change that to 0-1.
Simple solution was to multiply the input by 2 and call it good.
So with my variable declared as "streamin x;"
I wrote the code "x = x * 2;"
And at that point the code self destructed, outputting a signal of infinite amplitude or something. I did not feed it an input value out of range (0-1). Why would it do this? Is it creating an infinite loop? I don't see how that's possible since the operation should only be performed the one time every time the code runs through and as far as I know values aren't remembered by the code after ever step. Commenting out this line makes it work as expected again.
Anyone know? Thanks.
Simple solution was to multiply the input by 2 and call it good.
So with my variable declared as "streamin x;"
I wrote the code "x = x * 2;"
And at that point the code self destructed, outputting a signal of infinite amplitude or something. I did not feed it an input value out of range (0-1). Why would it do this? Is it creating an infinite loop? I don't see how that's possible since the operation should only be performed the one time every time the code runs through and as far as I know values aren't remembered by the code after ever step. Commenting out this line makes it work as expected again.
Anyone know? Thanks.