BCH and RS

I have been working on and off with advanced material in vector and tensor space, grad level math
anyway I was looking at error correcting code and noticed BCH as being a generalization over ideas like parity etc.
The syndrome is computed as a vector of
f(j) = (a_0)^j + (a_2)^j + ... + (a_s)^j
for odd i from 1 do d-1, where a_i is the i-th component
for some vector a
remember that f(2j) is simply the square of f(j))
Because in C++ we number from 0, f(j) will reside in location (j-1)/2
Let m=GF2E::degree() (i.e., the field is GF(2^m))
assume d is odd and greater than 1, and less than 2^m (else BCH codes don't make sense)
Place your rig specifics into your signature like I have, makes it 100x easier!
Hardcore Games Legendary is the Only Way to Play!
Vegan Advocate How can you be an environmentalist and still eat meat?

Hi Vegan,
Thanks for posting in VC++ forum.
VC++ forum aims to discuss and ask questions about the Visual C++ IDE, libraries, samples, tools, setup, and Windows programming using MFC and ATL.
This issue is not proper here. It is more related to math issue.
May
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Problem with ECS and XSD

    Hi B2B Gurus,
    We are facing the problem with ECS and XSD files from past 2 weeks, Steps we followed
    1. Created a ECS file in document editor version 11g: 6.6.0
    2. ECS files consists only from ST and SE segments
    Ex: ST
    BCH
    CUR
    REF
    PER -- Exclude
    TAX -- Exclude
    SE
    3: Generated a XSD file from ECS file( File --> export---> Oracle B2B) in document ediotr
    4. We imported a ECS and XSD file in B2B console( documents---docdef-transaction set ECS file) and XSD File
    5. We tested one file from manually we face below error:
    Error Code B2B-51507
    Error Description Machine Info: (usmtnz-dinfap19.dev.emrsn.org) Description: Payload validation error.
    Error Level ERROR_LEVEL_COLLABORATION
    Error Severity ERROR
    Error Text
    and some times it shows Guideline load Error or simply Error
    Please help us to resolve this
    Regards

    Anuj,
    We are sending the EDI XML file from backend, then B2B will convert it into EDI file, How can we analyze EDI XML file with ECS file, B2B is not converting to EDI.
    1. Can we use 10g ECS file and XSD file in 11G
    2. I tried to import it, but it showing below error while doing testing
    App Message property     {MSG_ID=90422086, Sequencing=false, DOCTYPE_REVISION=5020, MSG_TYPE=1, FROM_PARTY=EMERSON, DOCTYPE_NAME=850, TO_PARTY=APLL, ATTACHMENT=}
    Direction     OUTBOUND
    State     MSG_ERROR
    Error Code     B2B-51507
    Error Text     Error Brief : The element does not include any significant data.
    Error Description     Error : The Element PER02 does not include any significant data characters. Segment PER is defined in the guideline at position 3600.{br}{br}This error was detected at:{br}{tab}Segment Count: 11{br}{tab}Element Count: 2{br}{tab}Characters: 5395 through 5397
    Created Date     06/20/2011 02:52 PM
    Modified Date     06/20/2011 02:52 PM
    Note: I used the same files in 10G its working fine.
    Regards
    Edited by: Francis on Jun 20, 2011 10:48 AM

  • Advice for real performanc​e of LV8.5 operate in the XP and Vista

    Hi all
    My company had purchased new computers for LabVIEW programming purpose.
    We may install the LV8.5 in these computers but OS are not decided yet. Also, we have the current PC is only XP licensed
    Therefore, can anyone give the advice for the real performance advantage of using :
    LV8.5 with Vista over LV8.5 with XP
    LV8.5 with Vista over LV7.1 with XP
    LV7.1 with Vista over LV7.1 with XP
    New computers detail:
    Intel(R) Pentium(R)Dual-Core processor E2160
    BCH-P111 -1.80GHz, 1MB L2 cache, 800MHz FSB
    2GB RAM
    Thanks
    Best Regards
    Steve So

    The biggest issue I have seen with 8.5 Vista vs. XP is that if you leave Vista in the standard theme, the fonts have changed.  I designed several front panels to have them be out of whack with XP.  So if you are going to be using code across platforms, you need to keep in mind they will look different unless you use the XP theme in Vista, or customize your fonts to make sure they remain the same between the systems.  The dialog font is a different size (13 on Vista vs. 11 on XP), and a different font (can't remember the difference).  That was the big one I noticed.
    8.5 over 7.1 is mostly going to be the learning curve to learn the new features.  Overall, I have appreciated the changes, but there are some things (mostly development related) that I have seen run a little slower in 8.5 than in 7.1, but have not noticed any runtime issues as of yet.  One big change between the versions is application building, which is more complex in 8+.  I do appreciate the new features, though, but NIs project still hasn't rubbed me the right way yet.
    NI doesn't support LV 7.1 with Vista.  I have used it and haven't seen any problems, but that doesn't mean one won't pop up.  If you're going to stay with 7.1, you better stay with XP.  8.5 is the first version NIs supports as Vista compatible.  You will also have to use a relatively new set of device drivers, so if you have old hardware you are trying to use in your new system, make sure it is cimpatible with the latest drivers.
    I have actually had more issues with other hardware drivers and software packages than I have with LabVIEW.  TestStand is not yet supported in Vista, and i found out the hard way, one of the ways it is incompatible and had to move back to XP for devlopment.

  • Generating BCH Codes for Forward Error Correction

    Has anybody created VIs for generating BCH (Bose-Chaudhuri-Hochquenghem) error correction codes?
    I need to generate the codes for a 16 bit data packet.
    I've found samples in C on the web (http://www.eccpage.com/) but nothing in LV.
    Thanks,
    -dave

    I hate to bump a topic that is over 6 years old, but I am in need of a simple BCH encoding algorithm and do not have the toolbox which provides this.  I only need the encoding algorithm so I am hoping to implement this .VI posted here. 
    I have slightly altered the cleaned up version that was posted to have the inputs/outputs in a format that I expect, but I am worried that it is not correctly calculating the BCH code.  This is my first time working with BCH codes, but I need to implement the CCSDS version using n = 63, k = 56 7-bit BCH code with generator polynomial G(x) = x^7 + x^6 + x^2 + 1.
    I think when using 0xC5C5C5C5C5C5C5 as my input message the 7 bit BCH is supposed to be 0x43, but I am getting 0x00.  Could someone with more experience than me see if I did something obviously wrong?  Or know of a way to validate a BCH encoding algorithm, so I know if what I did was correct.  I attached my modeified .vi.  Thanks!
    Attachments:
    BCH_3.vi ‏24 KB

  • Where do i download file sRGB.pf and GRAY.pf .

    When i debug :
    public static ICC_Profile getInstance(String fileName)
    ICC_Profile thisProfile;
    thisProfile = getInstance("sRGB.pf);
    return thisProfile;
    desplay:
    An exception of type 'java.lang.StackOverflowError' was not handled'.
    Where do i download file sRGB.pf and GRAY.pf.
    Please help me . thank you !
    bch 11.MAR.2004

    This file should be located at jre/lib/cmm/sRGB.pf under the directory of the JDK installation.

  • X220 STRANGE MESSAGE POPPING UP EVERY NOW AND THEN

    There is none device connected to any of the three USB but I see the following message I quote:
    "ONE OF THE USB DEVICES ATTACHED TO THIS COMPUTER HA MALFUNCTIONED AND WINDOWS DOES NOT RECOGNIZE IT"  in the device manager there is one Generic US Hub indicates "UNKNOWN DEVICE" also in properties it is showing " Currently, this hardware device is not connected to the computer. (Code 45)"  as I wrote there is no USB device connected.  Please advise what's going on....!?!
    Solved!
    Go to Solution.

    I think that's the reason. USB port is sensitive to water, in a 100% humidity environment there could be water form inside your laptop.
    I think in manual it is clearly stated that do not use your ThinkPad in environment with humidity higher than 95% (which I think apply to any kind of electronic device without special protection)
    [2011]X220-4286-CTO(Brand new, hope nothing bad will happen to it...)[2008]X61-7673-CV2(Slipped upon it, but also working)[2002]X31-2672-BCH(Broke screen, but still working!)

  • BCH Encoder Labview

    Hello,
    i have a problem. I need a Channel Coding for a 56 Bit Bitstream. The code is a modified BCH-Code (63,56. My generator polynom is x^7+x^6+x^2+x^0.
    I have the NI Modulation Toolkit, but it dosnt help. In the MT BHC Encoder.vi i cant adjust the generatorpolynom and use the (63,56). 
    Has anyone an idee or an example for me? 
    thanks 

    Hi,
    the MT BHC.vi uses the order m to choose a polynomial from a table in a subvi inside MT BHC.vi.
    From outside it is not possible to specify a custom polynomial, so you could try to change is inside, but 
    I cannot tell what exactly happens there.
    Marco Brauner NIG

  • Code of BCH

    I want to make a code of BCH,first I want to realize (7,4)code. here is I made,but It has not finished
    Is there anybody know this and help me?
    thank you for entering and seeing
    Attachments:
    7-4汉明码.vi ‏57 KB

    Hi Fay
    BCH (coder and decoder) and others are implemeted in Modulation Toolkit.
    Perhaps you can ask your local NI representative to supply the bch vis.
    Cheers
    Alipio
    "Qod natura non dat, Salmantica non praestat"

  • A problem with Threads and loops.

    Hi, I have some code that needs to be constantly running, like while(true)
          //code here
    }However, the code just checks to see if the user has input anything (and then if the user has, it goes to do some other stuff) so I don't need it constantly running and hogging up 98% of the CPU. So I made my class (which has the method that needs to be looped, call it ClassA) implement Runnable. Then I just added the method which needed to be looped into the public void run()
    I have another class which creates an instance of the above class (call it ClassB), and the main(String[] args) is in there.
    public static void main(String[] args)
              ClassA test = new ClassA();
              Thread thread = new Thread(test.getInstanceOfClassA());
              thread.start();
              while(true)
                           //I do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...) but I can't think of away to get it to run - sleep - run -sleep forever. Can someone help me?

    Hi, I have some code that needs to be constantly
    running, like while(true)
    //code here
    }However, the code just checks to see if the user has
    input anything (and then if the user has, it goes to
    do some other stuff) so I don't need it constantly
    running and hogging up 98% of the CPU. Where does the user input come from. Are you reading from an InputStream? If so, then your loop will be blocked anyway when reading from the InputStream until data is available. During that time, the loop will not consume processor cycles.
    public static void main(String[] args)
              ClassA test = new ClassA();
    Thread thread = new Thread(test.getInstanceOfClassA());I have never seen this idiom. If ClassA instanceof Runnable, you simply write new Thread(test).
              thread.start();
              while(true)
    //I do not know what to put
    do not know what to put here
                   try
                        thread.sleep(100);
                   catch(InterruptedException iex)
         }However, the thread only calls run() once,(duh...)Yeah, why would you want to call it more than once given that you have an infinite loop in ClassA.run()?
    Harald.
    Java Text Crunching: http://www.ebi.ac.uk/Rebholz-srv/whatizit/software

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with Threads and "plase wait..."-Window

    Hi everyone,
    I have a problem that I'm not able to solve in any way... I have a time-consuming task (a file decryption) which I execute in a separate thread; I've used the SwingWorker class, like suggested by sun-tutorial, and it works right. The problem is that I have to wait that the decryption have finished before continuing with program-execution. Therefore I would like to display a "please wait"-window while the task runs. I've tryed all the possible ways I know but the problem is always the same: the waitWindow is displayed empty, the bounds are painted but the contents no; it's only painted when the decrypt-task has finished. Please help me, I have no more resources....
    decrypt-file code:
    public class DecryptFile {
      private String cryptedFileNameAndPath;
      private ByteArrayInputStream resultStream = null;
      // need for progress
      private int lengthOfTask;
      private int current = -1;
      private String statMessage;
      public DecryptFile(String encZipFileNameAndPath) {
        cryptedFileNameAndPath = encZipFileNameAndPath;
        //Compute length of task...
        // 0 for indeterminate
        lengthOfTask = 0;
      public ByteArrayInputStream getDecryptedInputStream() {
        return this.resultStream;
       * Called from ProgressBarDemo to start the task.
      public void go() {
        current = -1;
        final SwingWorker worker = new SwingWorker() {
          public Object construct() {
            return new ActualTask();
        worker.start();
       * Called from ProgressBarDemo to find out how much work needs
       * to be done.
      public int getLengthOfTask() {
        return lengthOfTask;
       * Called from ProgressBarDemo to find out how much has been done.
      public int getCurrent() {
        return current;
      public void stop() {
        current = lengthOfTask;
       * Called from ProgressBarDemo to find out if the task has completed.
      public boolean done() {
        if (current >= lengthOfTask)
          return true;
        else
          return false;
      public String getMessage() {
        return statMessage;
       * The actual long running task.  This runs in a SwingWorker thread.
      class ActualTask {
        ActualTask () {
          current = -1;
          statMessage = "";
          resultStream = AIUtil.getInputStreamFromEncZip(cryptedFileNameAndPath); //here the decryption happens
          current = 0;
          statMessage = "";
      }The code that calls decryption and displays waitWindow
          final WaitSplash wS = new WaitSplash("Please wait...");
          final DecryptFile cryptedTemplate = new DecryptFile (this.templateFile);
          cryptedTemplate.go();
          while (! cryptedTemplate.done()) {
            try {
              wait();
            } catch (Exception e) { }
          this.templateInputStream = cryptedTemplate.getDecryptedInputStream();
          wS.close();Thanks, thanks, thanks in advance!
    Edoardo

    Maybe you can try setting the priority of the long-running thread to be lower? so that the UI will be more responsive...

  • Problem with threads and graphics

    I have a thread that chooses paths for a Travelling salesman problem, it then calls a TSPdraw class and passes it the path, which the class then draws. the problem is when i have two threads it creates two windows but only draws a path in one of them. any ideas where i`m going wrong

    Are you using swing components? Swing isn't threadsafe. If you have multiple threads that want to update your UI you need to use the SwingUtilities.invokeLater(...)or invokeAndWait(...). There is a page in the swing tutorial about this at: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

  • Problem with threads and ProgressMonitor

    Dear Friends:
    I have a little problem with a thread and a ProgressMonitor. I have a long time process that runs in a thread (the thread is in an separate class). The thread has a ProgressMonitor that works fine and shows the tasks progress.
    But I need deactivate the main class(the main class is the user interface) until the thread ends.
    I use something like this:
    LongTask myTask=new LongTask();
    myTask.start();
    myTask.join();
    Now, the main class waits for the task to end, but the progress monitor don`t works fine: it shows only the dialog but not the progress bar.
    What's wrong?

    Is the dialog a modal dialog? This can block other UI updates.
    In general, you should make sure that it isn't modal, and that your workThread has a fairly low priority so that the UI can do its updating

  • Problem with threads and/or memory

    I'm developing an application where there are 3 threads. One of them sends a request to the other, and if the 2nd can't answer it, it sends it to the 3rd (similar to CPU -> CACHE -> MEMORY). When i run the program with 1000-10.000 requests, no problem occurs. When i run it with 300.000-1.000.000 requests, it sometimes hangs. Is this a problem with the garbage collector, or should it be related to the threads mecanism.
    (note: eache thread is in execution using a finite state machine)

    i had been running the program inside Netbeans.
    Running the jar using the command line outside
    Netbeans i have no more problems... Does Netbeans use
    it's own JVM?Depends how you set it up, but look under the options. There are settings for the compiler and jvm that it uses.

Maybe you are looking for

  • Is Adobe Bridge free with Photoshop and lightroom deal?

    Hello anyone, I have the Photoshop and lightroom deal subscription for Adobe CC.  But I don't know if Bridge free or extra?  in CC Apps there is an install option which suggests it's free were has other Apps have the try option.  Can any one help me

  • CUSTOM REPORT PROBLEM - REP-1213

    I am a student trying to complete a project. I developed a "custom" report form which uses 5 tables to generate the report. I have entered the 'fields' at various locations on the report form and when I run the report I get the following error messag

  • Oracle Siebel Adapter with Bpel or Oesb - SBL-JCA-00200

    Hi ALL, i am facing a problem by using Oracle Adapter for Siebel inside Soa Suite. mar., 2 déc. 2008 18:30:08.0343 CET - Thread[AWT-EventQueue-0,6,main] [info ] [IWAF JCA] [container] Loaded and initialized adapter class 'com.ibi.file.FileListenerAda

  • Serial number lightroom 5

    I don't have the serial number on my box from amazon on lightroom 5. I was on the phone 2 times with adobe and emailed them pictures of the box with no reply.

  • Print Woes...can't believe no one can help???

    I am at wit's end. I installed Leopard month's ago and have had problems printing ever since. I can print to a 8-1/2 x 11 through Quark, but cannot print 4x6 borderless prints in Imagebrowser any longer. I also recently downloaded the new 6.0.7.38 Im