White Noise Generator

Software questions and issues with the FV-1

Moderator: frank

Post Reply
ZibiSound
Posts: 66
Joined: Fri Mar 15, 2013 3:02 pm

White Noise Generator

Post by ZibiSound »

Hi,
Is there a way to generate white noise using FV-1 ?
Later I want to add a low pass filter to make something like step noise, but I can't find any program to generate noise.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

some lfsr code to generate random noise http://www.spinsemi.com/forum/viewtopic ... r&start=15
Frank Thomson
Experimental Noize
ZibiSound
Posts: 66
Joined: Fri Mar 15, 2013 3:02 pm

Post by ZibiSound »

Thanks, I think this is exactly what I need :)

Can you tell me what's the difference between 24 and 48bit version ?

And I have another question: If this code makes 4-position "switch":

Code: Select all

;Process Pot2 to decide 1 of 4 output possibilities 
    rdax   pot2,1    
    and    %01100000_00000000_00000000   ;mask off only 2 bits, leaving only 4 possibilities 
    skp    zro,LowPass          ;if zero, the skip over other code to Test1 
    sof    1,-0.25             ;subtract 1/4 
    skp    zro,BandPass          ;if zero, skip over other code to Test2 
    sof    1,-0.25             ;subtract 1/4 
    skp    zro,HighPass          ;if zero, skip over other code to Test3 
    clr                  ;clear the accumulator, there's 1/4 left in it! 
 NotchOut: 
    ldax   notch 
    skp   run, Pend         ;skip to end of code 
 LowPass: 
    ldax   lp_dly 
    skp   run, Pend         ;skip to end of code 
 BandPass: 
    ldax   bp_dly 
    skp   run, Pend         ;skip to end of code 
 HighPass: 
    ldax   hp 
    skp   run, Pend         ;skip to end of code 
 ; 
 Pend: 
    wrax   dacl,1            ;write both outputs 
    wrax   dacr,0  
So how can I do this "switch" 2-position ?
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

sebxx4 wrote:
Can you tell me what's the difference between 24 and 48bit version ?
The difference is 24-bits 8)
Just use the 24-bit version.
sebxx4 wrote: And I have another question: If this code makes 4-position "switch":

Code: Select all

;Process Pot2 to decide 1 of 4 output possibilities 
    rdax   pot2,1    
    and    %01100000_00000000_00000000   ;mask off only 2 bits, leaving only 4 possibilities 
    skp    zro,LowPass          ;if zero, the skip over other code to Test1 
    sof    1,-0.25             ;subtract 1/4 
    skp    zro,BandPass          ;if zero, skip over other code to Test2 
    sof    1,-0.25             ;subtract 1/4 
    skp    zro,HighPass          ;if zero, skip over other code to Test3 
    clr                  ;clear the accumulator, there's 1/4 left in it! 
 NotchOut: 
    ldax   notch 
    skp   run, Pend         ;skip to end of code 
 LowPass: 
    ldax   lp_dly 
    skp   run, Pend         ;skip to end of code 
 BandPass: 
    ldax   bp_dly 
    skp   run, Pend         ;skip to end of code 
 HighPass: 
    ldax   hp 
    skp   run, Pend         ;skip to end of code 
 ; 
 Pend: 
    wrax   dacl,1            ;write both outputs 
    wrax   dacr,0  
So how can I do this "switch" 2-position ?
Mask it to 1 bit and delete the subtraction steps, it will be either 0 or not 0 so no real need for any more than that.
Frank Thomson
Experimental Noize
ZibiSound
Posts: 66
Joined: Fri Mar 15, 2013 3:02 pm

Post by ZibiSound »

I will be something like this ?

Code: Select all

;Process Pot2 to decide 1 of 2 output possibilities 
     rdax   pot2,1    
     and    %01000000_00000000_00000000 
     skp    zro,LowPass          ;if zero, the skip over other code
     clr                  ;clear the accumulator
  NotchOut: 
     ldax   notch 
     skp   run, Pend         ;skip to end of code 
  LowPass: 
     ldax   lp_dly 
     skp   run, Pend         ;skip to end of code 
  ; 
  Pend: 
     wrax   dacl,1            ;write both outputs 
     wrax   dacr,0 
What with this mask ? 1bit is %01000000_00000000_00000000 ?
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

That will probably work. To understand the bit mask you need to understand the way numbers are represented in the FV-1, the way they are aligned, etc. Please see the SpinAsm PDF, it covers these things in detail.
Frank Thomson
Experimental Noize
Post Reply