static void setup_connection(FM_CH CH) {
        IntSubArray carrier = new IntSubArray(out_ch, CH.PAN); /* NONE,LEFT,RIGHT or CENTER */

        switch (CH.ALGO) {
            case 0:
                /*  PG---S1---S2---S3---S4---OUT */
                CH.connect1 = new IntSubArray(pg_in2);
                CH.connect2 = new IntSubArray(pg_in3);
                CH.connect3 = new IntSubArray(pg_in4);
                break;
            case 1:
                /*  PG---S1-+-S3---S4---OUT */
                /*  PG---S2-+               */
                CH.connect1 = new IntSubArray(pg_in3);
                CH.connect2 = new IntSubArray(pg_in3);
                CH.connect3 = new IntSubArray(pg_in4);
                break;
            case 2:
                /* PG---S1------+-S4---OUT */
                /* PG---S2---S3-+          */
                CH.connect1 = new IntSubArray(pg_in4);
                CH.connect2 = new IntSubArray(pg_in3);
                CH.connect3 = new IntSubArray(pg_in4);
                break;
            case 3:
                /* PG---S1---S2-+-S4---OUT */
                /* PG---S3------+          */
                CH.connect1 = new IntSubArray(pg_in2);
                CH.connect2 = new IntSubArray(pg_in4);
                CH.connect3 = new IntSubArray(pg_in4);
                break;
            case 4:
                /* PG---S1---S2-+--OUT */
                /* PG---S3---S4-+      */
                CH.connect1 = new IntSubArray(pg_in2);
                CH.connect2 = carrier;
                CH.connect3 = new IntSubArray(pg_in4);
                break;
            case 5:
                /*         +-S2-+     */
                /* PG---S1-+-S3-+-OUT */
                /*         +-S4-+     */
                CH.connect1 = null;	/* special case */

                CH.connect2 = carrier;
                CH.connect3 = carrier;
                break;
            case 6:
                /* PG---S1---S2-+     */
                /* PG--------S3-+-OUT */
                /* PG--------S4-+     */
                CH.connect1 = new IntSubArray(pg_in2);
                CH.connect2 = carrier;
                CH.connect3 = carrier;
                break;
            case 7:
                /* PG---S1-+     */
                /* PG---S2-+-OUT */
                /* PG---S3-+     */
                /* PG---S4-+     */
                CH.connect1 = carrier;
                CH.connect2 = carrier;
                CH.connect3 = carrier;
                break;
        }
        CH.connect4 = carrier;
    }