Tables APEX_APPLICATION - phase?

I'm really struggling to get my head around this. I am generating a region of report using APEX_ITEM and my code looks like this:
select
ac.short_desc || apex_item.hidden(1, ac.short_desc) "short_desc",
apex_item.checkbox(2,ac.audit_check_id,'UNCHECKED') "Fail"
from audit_check ac
where active_flag = 'Y'
and department_id = 1
I use a validation to loop through the array of checkbox and return the value of the field short_desc. There are only 2 rows in my region to report, but strangely, if I check the first box, which seems to return the value of the second line of the report, not the first short_desc.

This is the code I use to return the value of short_desc, I rewrote it as a simple debugging output to see what is happening. If I check the first box, I get the second value of short_desc instead of the first. I am doing something stupid here? Code below:
begin

FOR i in 1..APEX_APPLICATION.G_F02.COUNT LOOP

wwv_flow.debug(APEX_APPLICATION.G_F01(APEX_APPLICATION.G_F02(i)));

end loop;

end;
Also, if I choose the second box, I get an ORA-01403: no given available error, as he is looking for a value of table that does not exist.

Hello:

Your validation needs are not related to the question that started this thread.
You can consider using javascript to validate the contents of the text box on the form. Something like

arr1 = document.forms[0].f02;
arr2 = document.forms[0].f03; // the textarea
for (i=0;i.value=='') alert ('error message here');}...

Edited by: varad acharya on Nov 11, 2009 5:34 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

Tags: Database

Similar Questions

  • APEX_APPLICATION. G_F0x tables in the query

    Hello

    Is it possible to use APEX_APPLICATION. G_F0x tables in the query and select it at the table?

    I like to select values from table bunch I have on the table.
    Of course I can loop table, but I like to select at once as
    SELECT e.*
    FROM emp e
    WHERE EXISTS(
      SELECT 1
      FROM TABLE(APEX_APPLICATION.G_F01 AS empno) a
      WHERE e.empno  = a.empno
    )
    I don't know is it still possible.

    Thanks in advance.

    Kind regards
    Jari

    Jari

    No, you cannot use the TABLE operator on a PL/SQL associative array as apex_application.g_f01: it requires a nested table or a table variable declared as an object database. You can access apex_application.g_f01 by using a function in the pipeline in this way.

  • measurement of the phase of the signal

    Hi all

    I'm trying measureme the phase of the sine wave.

    I produced sine waveform and give '' measure spectral '' VI express to measure the magnitude and phase. The block of spectral measure gives picture of the spectrum amplitude and phase with the difference in frequency of 1 Hz.

    The input signal is 10 Hz sine wave. so I checked the 10th item in the table of phase and amplitude. I'm getting the right size. but I get different values for phase measurement

    For example, if the input signal of 0 degrees phase shift, the spectral measure gives as-90 degree. If the input signal has the phase shift of 20 degrees, the measure blocks gives as-70 degrees.

    I can't able to find that how to pass this phase-90 degree occurs.

    Kindly help to solve. I thank in advance.

    with respect,

    Renaud V

    Renaud V,

    The spectral measurement VI uses the FFT internally. In the detailed help for the FFT, the following definition is displayed:

    Note that exp(-j*2*pi*theta) = cos(2*pi*theta) - i * sin(2*pi*theta). This phase shift is defined in respect to the cosine, and non sine, explaining the 90-degree turn.

    Lynn

  • How to validate 2 dates in a table

    Hello

    I have a tabular presentation. I have extension_date and 2 columns end_date. I need to create a validation "extension_date must be greater than end_date". I tried below, but it didn't work. Advice would be useful. Thanks in advance.

    Control details

    Validation of the column,
    Type: Function return Boolean

    If to_date (: P40_EXTEND_DATE, ' HH:MIPM MON-DD-YYYY') > to_date (: P1_END_DATE, ' HH:MIPM MON-DD-YYYY "")
    then
    Returns true;
    on the other
    Returns false;
    end if;

    Alexander wrote:
    Hello

    I have a tabular presentation. I have extension_date and 2 columns end_date. I need to create a validation "extension_date must be greater than end_date". I tried below, but it didn't work. Advice would be useful. Thanks in advance.

    Control details

    Validation of the column,
    Type: Function return Boolean

    If to_date (: P40_EXTEND_DATE, ' HH:MIPM MON-DD-YYYY') > to_date (: P1_END_DATE, ' HH:MIPM MON-DD-YYYY "")
    then
    Returns true;
    on the other
    Returns false;
    end if;

    You can use arrays of apex_application.g_fxx instead of use of bind variables in the validation code. To identify which tables apex_application.g_fxx correspond to the columns of your date, you have to look at the HTML source generated page or check out this link for more information:
    http://www.inside-Oracle-apex.com/which-tabular-form-column-is-mapped-to-which-apex_applicationg_fxx-array/

    Once you have identified the elements of the array, you can use them in your validation. An example is explained here:
    http://Apex.Oracle.com/pls/OTN/f?p=31517:41

    Thank you
    Rohit

  • How to interpret the orbit and Point of reference Timebaseplot

    Hello

    the plot of the orbit and the time base includes a "red dot" called the reference point. I really didn't understand this meaning.

    Please, take a look at the photo "orbit_timbase_plot. PNG ".

    Thanks a lot for your help!

    SVX orbit and the basic plot of time (filtered) (Ch N - M orders) .vi accepts the size of entry and entry order height OATS phase and Phase (Signal the same Angle, N channels) .vi.

    If you want to extract the information from the phase of the red dot, you can just get the 2D cluster table 'phases' [lag phase].

    When "bandwidth [command]" is set to 1, and 'selection of the category axis' is set to the time, the 'phase' table in ' phases [offset] "corresponds to the phase of each red dot, the" time/rev/rpm"table in" phases [offset] "corresponds to the value of data orbit/time base reference.

  • Defining an NVL on a column in a generated Wizard tab form

    Version 4.2.6.00.03

    Hello

    I have a form wizard generated tab that has a column which is populated with a default value.

    A request has come in that, if the user deletes by default and makes NULL and submit the form add a 0 (zero) instead of the default value.

    It is only if they remove the value that's already there.

    Can someone help me reach this goal?

    Thank you

    Joe

    Joe R wrote:

    I have a form wizard generated tab that has a column which is populated with a default value.

    A request has come in that, if the user deletes by default and makes NULL and submit the form add a 0 (zero) instead of the default value.

    It is only if they remove the value that's already there.

    Can someone help me reach this goal?

    Create a process on submit - after calculations and Validations of PL/SQL with a lower sequence number than the SRM process generated by the wizard that affects the corresponding value in table apex_application.g_fxx 0 where it is null; for example:

    begin
    
      for i in 1..apex_application.g_f01.count
      loop
        apex_application.g_f01(i) := coalesce(apex_application.g_f01(i), '0');
      end loop;
    
    end;
    
  • A Question for the Experts of the SAMS

    Hello

    Version Oracle 10.2.0.4
    16 k block size
    I have a managed tablespace locally, with volume of uniform measurement of 128 k and SSM set to AUTO. My tablespace is called rj_test_X128K in the following test:
    dba@TEST> create table dba.rj_del_ins_test
      2  tablespace rj_test_X128K
      3  as
      4  select *
      5  from table
      6  where PK_COL > 1135268669
      7  and PK_COL is not null;
     
    Table created.
     
    dba@TEST> exec dbms_stats.gather_table_stats('dba', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
     
    PL/SQL procedure successfully completed.
     
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
     
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    ------------------------------ ---------- ---------- ---------- ------------ ---------- ----------- -------------------
    RJ_DEL_INS_TEST                                84217        868            0          0         141           0
     
    dba@TEST> delete from dba.rj_del_ins_test
      2  where PK_COL > 1135268669
      3  and mod(PK_COL,20) = 10;
     
    4143 rows deleted.
     
    dba@TEST> commit;
     
    Commit complete.
     
    dba@TEST> exec dbms_stats.gather_table_stats('dba', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
     
    PL/SQL procedure successfully completed.
     
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
     
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    ------------------------------ ---------- ---------- ---------- ------------ ---------- ----------- -------------------
    RJ_DEL_INS_TEST                                80074        868            0          0         141           0
     
    dba@TEST> insert into dba.rj_del_ins_test
      2  select *
      3  from table
      4  where PK_COL > 1135268669
      5  and PK_COL is not null
      6  and mod(PK_COL,20) = 6;
     
    4277 rows created.
     
    dba@TEST> commit;
     
    Commit complete.
     
    dba@TEST>
    dba@TEST> exec dbms_stats.gather_table_stats('dba', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
     
    PL/SQL procedure successfully completed.
     
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
     
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    ------------------------------ ---------- ---------- ---------- ------------ ---------- ----------- -------------------
    RJ_DEL_INS_TEST                                84351        911            0          0         141           0
    I noticed that the number of blocks increases even though I'm only insert additional lines very little - 134 to be exact. Using the length of middle line of 141, which takes me to 134 * 141 = 18894bytes; a little more 1 block. I have an increase of 43 blocks. No idea why?

    I understand that there is a general fresh management regarding the use of space when you use SAMS, but I don't understand why there is such an increase in the number of blocks when I would have thought that the blocks were already allocated in the initial table creation phase. If I had inserted thousands of lines, I would have understood the jump in the use of block, but not with 134.

    Here are the results of the DBMS_SPACE. Procedure SPACE_USAGE
    UNF         0
          UNFB         0
           FS4         0
          FS4B         0
           FS3         0
          FS3B         0
           FS2         0
          FS2B         0
           FS1         2
          FS1B     32768
          FULL       891
         FULLB  14598144
    FS1
     Number of blocks that has at least 0 to 25% free space
    FS1B
     Number of bytes that has at least 0 to 25% free space
    FULL
     Total number of blocks that are full in the segment
    FULLB
     Total number of bytes that are full in the segment
    I used the DBMS_SPACE. Procedure UNUSED_SPACE and got these results:
    TOTAL_BLOCKS    912
    TOTAL_BYTES        14942208
    UNUSED_BLOCKS   0
    UNUSED_BYTES    0
      LASTEXTF      251
     LAST_EXTB      909
    LASTUSEDBLOCK   8
    
    Definitions taken from the docs:
    
    total_blocks
     Returns total number of blocks in the segment.
    total_bytes
     Returns total number of blocks in the segment, in bytes.
    unused_blocks
     Returns number of blocks which are not used.
    unused_bytes
     Returns, in bytes, number of blocks which are not used.
    last_used_extent_ file_id
     Returns the file ID of the last extent which contains data.
    last_used_extent_ block_id
     Returns the starting block ID of the last extent which contains data.
    last_used_block
     Returns the last block within this extent which contains data.
    Following this, here is how the stats are the deletion and insertion, shown in two steps:
    ##############
    # After deletion
    ##############
    
    FULL      850
    FULLB     13926400
    
    TOTAL_BLOCKS              872
    TOTAL_BYTES             14286848
    UNUSED_BLOCKS           4
    UNUSED_BYTES            65536
    LASTEXTF                 251
    LAST_EXTB            869
    LASTUSEDBLOCK            4
    
    109 extents
    
      NUM_ROWS     BLOCKS
    ---------- ----------
         80074        868
    
    ##########
    # After Insert
    ##########
    
    FS1              1
    FS1B          16384
    FULL            892
    FULLB           14614528
    
    TOTAL_BLOCKS              912
    TOTAL_BYTES             14942208
    UNUSED_BLOCKS           0
    UNUSED_BYTES                0
    LASTEXTF                 251
    LAST_EXTB            909
    LASTUSEDBLOCK           8
    
    114 extents
    
     NUM_ROWS     BLOCKS
    --------- ----------
        84351        911
    So, can someone get to explaining why this is happening?
    Or maybe some additional tests I can do to see what blocks are used for?

    Thank you
    SoC

    Rob_J wrote:
    As you can see, TEST 2 shows that, when you use the representative settings for PCTFREE and PCTUSED in MSSM to those of the SAMS, we get a result comparable to the use of SAMS.

    So, regardless of what I set PCTFREE to SAMS tablespace in a block must still have more than 25% of free space to be a candidate for the new pads?

    Not exactly - I think it is the next "Freeness" below PCTFREE, so if PCTFREE is for example 26%, then the block must have at least 50% free for its status as a 'FULL' erased and become a candidate for inclusion. PCTFREE under 25, Yes, then at least 25% I guess.

    Is it possible to change this behavior is this just a call, you have to take for the use of SAMS or y at - it a logical reason behind what I missed?

    Well, I guess that's what you get with segments 'AUTO' managed by magic - if the theory is correct, you can try a PCTFREE of 24 or 25 (not sure of the border), then several blocks should become eligible for the status of compensation when deleting lines. Of course, it's different from what you can achieve with MSSM - you are reserving more space for the growth future line with PCTFREE 25.

    Remember that the default PCTUSED is 40 for MSSM if you do specify not her - so the default behavior of the SAMS with 10 PCTFREE is already more aggressive towards provision for blocks compared to default MSSM insertions.

    You must also consider that SAMS was designed especially for the systems highly concurrent OLTP (and CARS) which deals, so there are many other considerations to take into account, as the way in which SAMS affects free to the various processes blocks and restraint potential reliefs on the segment header (similar to the use of FREELISTs and FREELIST groups with MSSM).

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    Co-author of the forthcoming "OakTable Expert Oracle practices" book:
    http://www.Apress.com/Book/view/1430226684
    http://www.Amazon.com/Expert-Oracle-practices-database-administration/DP/1430226684

  • Referring to APEX_APPLICATION values. G_F (n) table without a process OnSubmit.

    I have box implemented as a column of report on an APEX report page. I try to access control values in a PLSQL process using APEX_APPLICATION. G_F01. It works very well in an OnSubmit Page process, but does not return a value if used in dynamic action. I think that APEX_APPLICATION. G_F01 returns the values checked only on the page. Is it all work around I can extract the values checked in dynamic action that is triggered by the change of box event.

    Thanks in advance

    Hina

    Hi HIna,

    I created an example for you

    https://Apex.Oracle.com/pls/Apex/f?p=245:11

    Steps are below:

    1. report query

    Select

    apex_item. CheckBox2 (1, empno) empno, ename, sal from emp;

    2 dynamic Action:

    var arr_f01 = [];

    () $("input[name='f01']:checked").each

    function() {}

    arr_f01.push ($(this).) Val());

    });

    Alert (arr_f01);

    (apex). Server.Process

    'PROCESS_CHECKED '.

    , {f01: arr_f01}

    , {dataType: "text"}

    , success: {function (pData)}

    Alert ('data inserted into the Temp Table');

    } }

    );

    3. the application process:

    Start

    I'm looping 1.apex_application.g_f01.count

    insert into temporary values (APEX_APPLICATION. G_F01 (i));

    commit;

    end loop;

    end;

    It works for me. The only change I see in my and your query is of the Data Type in apex.server.process.  I assume that the default is JSON, you need to change to 'text '.

  • Remove the table if the value not in APEX_APPLICATION. G_f01?

    Hello again!

    I have an apex_application.g_f01 that contains the values in the boxes, now I want apex to remove rows from the table that contains values that are not present in the G_f01 (what are disabled) on submit.

    I can't understand the sql code to do this, could someone give an example?

    This can be a simple thing, but I'm getting confused a lot with sql, maybe because I just php and java.

    EgaSega wrote:

    I have an apex_application.g_f01 that contains the values in the boxes, now I want apex to remove rows from the table that contains values that are not present in the G_f01 (what are disabled) on submit.

    I can't understand the sql code to do this, could someone give an example?

    This can be a simple thing, but I'm getting confused a lot with sql, maybe because I just php and java.

    One possibility would be to create a collection of APEX containing key checked values and use that as the source of the lines to be kept in the SQL delete. Something like:

    begin
    
      apex_collection.create_or_truncate_collection('CHECKED_VALUES');
    
      for i in 1..apex_application.g_f01.count
      loop
        apex_collection.add_member(
            p_collection_name => 'CHECKED_VALUES'
          , p_c001 => apex_application.g_f01(i));
      end loop;
    
      delete from t
      where not exists (select
                           null
                       from
                            apex_collections c
                       where
                           collection_name = 'CHECKED_VALUES'
                       and c.c001 = t.id);
    
    end;
    
  • difference of phase for LabView

    Hi guys,.

    I need help in this program I am writing. I'm trying to calculate the difference in phase between two different simulated sinusoids. I searched online and found out that I could do that using retrieves your unique information and subtracting one phase to the next. However, I struggle to connect the wires, and I'm not sure why he does not connect properly. Forgive me if this is a fundamental problem, as I'm new to LabView. Thank you. The program is attached.

    aclx

    aclx,

    It would be probably better if you posted your question for the LabVIEW Board rather than the Board of Signal conditioning. This Board gets about 1% only as much traffic as the LV Board and your question has nothing to do with conditioning of signals.

    You have two questions.

    1. the Type of dynamic data (evil) generated by the screw Express mask all the information about what's on the wire.  It seems that the default conversion performed by the entry to retrieve only your Information.vi was in a table of waveforms.  This gives a picture of phases out. You can tell what kind of data is on a wire or why a thread is interrupted by pointing the cursor to tool of wiring on the wire with the open contextual help window.

    2. the relationship of phase between two signals of different frequencies is not defined. What moment in time should be used as the reference?  How acquired or simulated signals relate to that time on the iterations of the loop?

    The first issue can be fixed by explicitly converting DDT to a waveform as shown below.

    For the second question, you need to define what you mean by the phase shift of two different frequency signals.

    Lynn

  • Why the table in the output of MT complex waveform modulation FSK 255 elements missing?

    Hello! I posted my question in the LabVIEW forum but an application engineer suggested I post here. I'm new so any help would be appreciated

    I use this example FSK in LabVIEW (VI is attached). As it can be seen in the block diagram, the number of samples by specified symbol is 512. If I run 2 - FSK, I have 1 bit per symbol. So I if I have 128 bits, 128 symbols. and if I have 512 samples per symbol, I expect 65536 samples/elements in the complex waveform of the MT output modulation FSK. However, I get only 65281 elements in the table. There are 255 missing items.

    If I run 4 - FSK and have 128 bit or 64 symbols, I expect to 32768 in the table. But then again, I'm running out of 255 items and get 32513.

    Am I missing out on something? Have I misunderstood something? Thank you very much for your help.

    I get the same results as you!

    I Dove a little inside, and it seems that the code that generates the symbols, two layers down, which reports an explanation to this.

    If you open MT modulate FSK.vi, then mod_FSK modular Phases.vi discontinuous to generate in the discontinuous case of the structure of the case, you will see the following code.

    You can see that when Reset is set to True (the default) and the external-loop for is in his first race, the inner-loop for work (samples per symbol) / 2 + 1 times (in your case, this number is 512 / 2 + 1 = 257.) Subsequently, the inner-loop for runs with 512 for each outer loop for iteration. This means that the first round fail to 512-257 = 255 samples, which causes the total to 255 less samples.

    I don't know what is the motivation behind this design. As a test, you could connect in a constant False to Reset of the MT Terminal modulated FSK VI, which causes all the samples to generate.

    Hope that clarifies it.

  • Zero Phase filter

    Hi all

    I was hoping that someone can point me in the right direction, because I've been searching the net and banging my head against the wall.

    I want to filter the data, but eliminate the phase.  Data are data from the simple will be stored in a table for post-processing.  Is NOT in real time (making zero phase in real time is not possible, because we need to look to the future).  I'm looking to use this:

    http://zone.NI.com/reference/en-XX/help/372636F-01/mstudiowebhelp/HTML/92d15f99/

    and also if we look at the IirFilterBase class, there is the above method of zerophaseFiltering that we can use:

    http://zone.NI.com/reference/en-XX/help/372636F-01/mstudiowebhelp/HTML/bbfa383/

    When I have trouble, is to know how to write the code to call the class and method in c#.  I followed the example of code to tell a more traditional filter (such as butterworth etc.), and I am successfully using those... so nothing new to c# or programming to all...

    Any who have an example or point me in the right direction on how I can use these features?

    Is "IirFilterBase" common to all other filters, and we just need to pass the correct parameters for filtering done with zero Phase?  In MATLAB, there is a function of simple 'filtfilt' to have done that, but for the life of me, I can't figure out how to have my filtered data, but eliminate angles of phase in with measurement of the Studio.  I use MS 2012.

    Thanks in advance for any help! Trully appreciate it!

    Thank you for your answer!

    I guess that I won't be able to use then.  I'll try to take a more traditional approach as described here:

    http://www.dspguide.com/CH19/4.htm

    Filter toward the front, then on the other hand and then combine the result.  I can easily implement what an IIR butterworth filter, and given that my data is stored (non-real time), should be simple to implement.

    Will have to test this...

    Thanks again for your time... enjoy it!

  • To convert a double complex 2D table array 2D of real double 64-bit

    Hello

    I have a table 2D double complex numbers that I have to establish a curve of intensity. Now I create the node property to scale Z scale with the maximum and the minum range. See the attached VI. There is a conflict between the type... How is possibel to convert?

    Thank you

    smercurio_fc wrote:
    If you just want to draw the scale then direct the value of your complex in the complex of the polar function.

    Because of scale (and not the phase) use the function absolute value from table 2D complex. It is a little faster because it is simpler and gives the same result.

  • Impedance and exit Angle of Phase with Keysight 4294

    Hello

    I use LabView to run my 4294A Keysight impedance Analyzer.  I was able to get the program to initialize and configure all settings and take the date of clearing the open and short my 16047 D test set-up.  After that I'm sticking my OTC in the son will continue formatting graphics and the autoscaling them.  When I use the memory tables and reading of data to view graphical waveform data and a table, the | Z | data (impedance) are displayed correctly but I have not been able to get to the exit data (phase) of theta will display correctly on the graph or table.  I tried switching active traces and use several functions to read but so far I can't make it work.

    Anyone know how to make this work?

    Thank you all,

    Logan

    T..

    I could understand by comparison with another measure of instruments that the secondary output is the impedance of the imagination and here to compute the phase angle using the arctan of the imaginary in the primary.  Thank you for answering my problem and I hope that this thread can help someone who has the same problem.

    Logan

  • Bill land - problem with phase

    I have a problem of implementation during the attempt to produce traces of Bode for my team designed the hardware. I have now successfully been able to produce the data you expect, with a single question. Part of the phase of data points are the opposite of what is expected. I'll explain the process used...

    The material, I log in allows me to inject the signals on channels, but also the flow of these channels of my PC application for analysis. The function that I'm trying to replicate is a frequency sweep, as follows:

    -major equipment to replace a channel (the stimulus) with an sine wave frequencies, f

    -broadcasting the channel stimulus as well as his response to a certain channel number of cycles, P

    -the analysis ("transfer function") on the stimulus and data stream response strings

    -connect the frequency (f) with the phase intended to produce a Plot of Bode and corresponding calculated magnitude

    -increase the frequency (f) and repeat steps

    This code example is 'analysis' performed:

    int i, MaxMagIdx, DontCareIdx;

    Double * TimeInMag,.
    * DontCareArr,
    TransferReal,
    TransferImg,
    TransferMag,
    TransferPhase,
    DontCare,
    AdjFreq;

    NIComplexNumber * TimeSweepIn,.
    * TimeSweepOut,
    * FFTSweepIn,
    * FFTSweepOut;

    TimeSweepIn = malloc (gSweepCountMax * sizeof (NIComplexNumber));
    TimeSweepOut = malloc (gSweepCountMax * sizeof (NIComplexNumber));
    FFTSweepIn = malloc (gSweepCountMax * sizeof (NIComplexNumber));
    FFTSweepOut = malloc (gSweepCountMax * sizeof (NIComplexNumber));

    TimeInMag = malloc (gSweepCountMax * sizeof (double));
    DontCareArr = malloc (gSweepCountMax * sizeof (double));

    int InputSigIndex;

    unsigned char OverrideMsg [L_ADC_OVERRIDE_RQ] is {0};.

    for (i = 0; i<>
    {
    TimeSweepIn [i] .reellement = gSweepInArr [i];
    TimeSweepOut [i] .reellement = gSweepOutArr [i];
    TimeSweepIn [i] .imaginary = 0.0;
    TimeSweepOut [i] .imaginary = 0.0;
    }

    CxFFTEx (TimeSweepIn, gSweepCountMax, gSweepCountMax, NULL, FALSE, FFTSweepIn);
    CxFFTEx (TimeSweepOut, gSweepCountMax, gSweepCountMax, NULL, FALSE, FFTSweepOut);

    for (i = 0; i<>
    {
    ToPolar (FFTSweepIn [i] .reellement, FFTSweepIn [i] .imaginary & TimeInMag [i], & DontCareArr [i]);
    }

    MaxMin1D (TimeInMag, gSweepCountMax, & DontCare, & MaxMagIdx, & DontCare & DontCareIdx);

    CxDiv (.reellement [MaxMagIdx] FFTSweepOut, FFTSweepOut [MaxMagIdx] .imaginary,
    FFTSweepIn [MaxMagIdx] .reellement .imaginary FFTSweepIn [MaxMagIdx],
    & TransferReal, & TransferImg);

    ToPolar (TransferReal, TransferImg, & TransferMag & TransferPhase);

    TransferMag = 20 * log10 (TransferMag);
    TransferPhase = RadToDeg (TransferPhase);

    AdjFreq = (double) ((unsigned long) (gSweepFreq * 0 x 200000000 / (double) 50000000)) * 0 200000000 50000000 x / (double);

    fprintf (Logfile_Handle, "% lf\t%lf\t%lf\n", AdjFreq, TransferMag, TransferPhase);

    Free (TimeSweepIn);
    Free (TimeSweepOut);
    Free (FFTSweepIn);
    Free (FFTSweepOut);
    Free (TimeInMag);
    Free (DontCareArr);

    It works almost perfectly. The problem is that the calculated phase will be positive when there should be negative and vice versa.

    Here's a graph of the data produced:

    This is what is expected:

    Here are the two bunk:

    The expected plot was produced by the log file of cheating. I went and I didn't change the incorrect points to negative values. I want to eliminate this step. As you can see, if incorrect data are reflected on the zero line, it's what we expect. This "expected" given corresponds to what material Analyzer of my colleague (Venable device) when it is used on our device.

    We believe that the issue is not with carried out complex math, but a problem in the FFT function or the selection of the index to use on the data table.

    Hi PedroMunoz,

    It was random semi.

    With the help of a licensed physicist with a PhD, the solution was discovered.

    When a FFT is performed, the output is a complex signal frequency. Convert this signal complex in amplitude and phase. The signal amplitude must contain a pic. The ridge of the signal amplitude is located at the frequency at which the sample represents. I understood.

    However, reading the FFT also of output magntiude contains a second peak. This second peak is negative frequency, and to analyze these data point conjugate complex is necessary. This second Summit should theoretically have the same amplitude, described as:

    F (f) = F * (-f)

    What interests me in recovering is F (f). What was happening was because F (f) and F * (-f) are theoretically the same (hence, they should the two registry as the maximum value of the table), F * (-f) would sometimes be picked up as the maximum value of the table instead of F (f), perhaps because of the noise. So I just need to make sure that I'm not the negative frequencies in my table.

    To ignore the F * (-f), all I had to do was only to watch a half of my output of the FFT. When I change my code for:

    TimeInMag = malloc (gSweepCountMax/2 * sizeof (double));
    DontCareArr = malloc (gSweepCountMax/2 * sizeof (double));

    for (i = 0; i
    {
    ToPolar (FFTSweepIn [i] .reellement, FFTSweepIn [i] .imaginary & TimeInMag [i], & DontCareArr [i]);
    }
    MaxMin1D (TimeInMag, gSweepCountMax/2, & DontCare, & MaxMagIdx, & DontCare, & DontCareIdx);

    I'm ignoring the negative frequencies. By setting the parameter 'shift' of CxFFTEx to FALSE, it organizes the positive frequencies in the first half, then the negative frequencies in the second. I pick up is no longer the wrong index, which would result in the phase reverse reading.

    I hope this helps someone else in the future!

Maybe you are looking for

  • Sign-in attempt prevented Gmail from mail.app

    I get an email back from Google who said that an unauthorized device just tried to access your account.  If I look in the newspapers at this time, there are entries like this: [IMAP] EU Domain error = MCMailErrorDomain Code = 1030 "IMAP"AUTHENTICATE"

  • I had the logmein123 call yesterday, may 10, 2011. What should I do?

    I had the logmein123 scam yesterday, may 10, 2011.  I questioned the and talked to 3 people, but they were all so 'persistent' [persistent] and showed me all the "problems" at my computer, that I don't give any personal information. and access to the

  • Change the icons in the home screen using native application

    Hi all Is any way to change the icons in the home screen (such as: downloads, browser, contacts power Turn Off etc.) using a native app in addition to change the theme? THX, MAZ

  • Random blackBerry 10 back hub

    Hey,. I get this problem in my phone when I stayed in the hub and I slip out of him to open an application, a few milliseconds after I slipped out and open the app the app minimizes all of a sudden and the hub opens again, as if I had slipped up and

  • Support for Linux in Smartphones blackBerry - marketing Dept.

    Sale of RIM rose by 102% to $1.88 billion for the quarter ending March 1 08. What are the chances of RIM having sufficient funds or will support, customers using Linux? A community which grew to 1.37% in September 2007 to 2.09% in October 2008. PS Ub