Matlab Help, Digital Audio Watermarking

Discussion in 'Programmer's Corner' started by Ron_7, Jan 31, 2007.

  1. Ron_7

    Thread Starter New Member

    Dec 18, 2006
    8
    0
    Hello Guys

    i'm am currently working on implementing Ricardo A. Garcia's algorithm for digital audio watermarking using a pyschoacoustic auditory model and spread spectrum for generating the watermark.

    so far i have implement the auditory model and am now onto generating the watermark. however i have come to a issue wich i hope some one has the answer to.

    i need to create a pseudorandom (PN) binary sequence of length 3000. Can anyone help me implement this please?

    Thanks in advance

    Ron
     
  2. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    143
    Can I be clear here?

    Are you trying to generate a binary sequency 3000 bits long? :eek: Or are you trying to generate a number up to (from 1 to) 3000, which can then be converted to a binary representation (requires 12-bits)?

    Dave
     
  3. Ron_7

    Thread Starter New Member

    Dec 18, 2006
    8
    0
    hi

    i'm trying to generate a binary sequence of 1s ands -1s upto length 3000.
     
  4. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    143
    Seems strange that you are looking to generate a binary sequence of 1 and -1, should it be 1 and 0?

    Either way you could look at the following method using the rand function and thresholding the answer:

    Code ( (Unknown Language)):
    1.  
    2. rand_arr = rand(3000,1);
    3. rand_seq = ones(3000,1);
    4.  
    5. for n = 1:3000
    6. t = rand_arr(n,1);
    7. if t < 0.5
    8. rand_seq(n,1) = -1;
    9. end
    10. end
    11.  
    This will generate a 3000x1 array of random digits that are either 1 or -1. You can change the thresholding which is currently 0.5. You can then look at manipulating the array as required.

    Dave
     
  5. mustafa_i

    New Member

    May 9, 2007
    2
    0
    u can use normrnd() function
     
  6. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    143
    That requires the Statistics Toolbox.

    Dave
     
Loading...