Cart | Help
 You are here: NI Home > NI Developer Zone > NI Discussion Forums Select Community English Français Italiano 日本語 한국어 Español 简体中文 繁体中文 Português (BR)

Knight of NI
Posts: 10,210

# Re: array subset output malfunction

[ Edited ]

I ran your code and attempted concatenating all the data within a single array for each of the magnitude, phase and coherence.

The above graphs show the concatenated results, wheras the bottom shows your original results.

I know I'm rusty in this area, but neither look correct.  What should be the correct output?  What are you expecting?

.
(starting to) See Life in a brand new way...

b* ^ )
Member
Posts: 24

# Re: array subset output malfunction

Thanks Ray!

If I am thinking about this right, concatenation is where the array is added from one end to the other.  So for concatenation the array AB(length 2)+CD(Length 2)=ABCD (Length 4)?  Whereas I need an ensemble of the data, Array (AB+CD)/2=AD (Length 2) Where each point in AB and CD is added then divided by 2.

The magnitudes are the same, when scaled correctly.  I am trying to get the same as the Bode plot for the SS Matrice in the first .vi or matalb.  Coherence of the concatenation looks pretty good.

Knight of NI
Posts: 10,210

# Re: array subset output malfunction

northwood wrote:

Thanks Ray!

If I am thinking about this right, concatenation is where the array is added from one end to the other.  So for concatenation the array AB(length 2)+CD(Length 2)=ABCD (Length 4)?  .

Yes

northwood wrote:
Whereas I need an ensemble of the data, Array (AB+CD)/2=AD (Length 2) Where each point in AB and CD is added then divided by 2.

Well...  there are 10 iterations..  So it would become ABCDEFGHIJKLMNOPQRST, so do you still divide by 2?

Or do you mean: (AB+CD+EF+GH+IJ+KL+MN+OP+QR+ST)/10  ?

Are we looking at an average of each iteration?  You lost me..

northwood wrote:
The magnitudes are the same, when scaled correctly.  I am trying to get the same as the Bode plot for the SS Matrice in the first .vi or matalb.  Coherence of the concatenation looks pretty good.

So you mean the plots I provided actually looked like what you were looking for?  If so, I can post the code change for you.

.
(starting to) See Life in a brand new way...

b* ^ )
Member
Posts: 24

# Re: array subset output malfunction

northwood wrote:
Whereas I need an ensemble of the data, Array (AB+CD)/2=AD (Length 2) Where each point in AB and CD is added then divided by 2.

Well...  there are 10 iterations..  So it would become ABCDEFGHIJKLMNOPQRST, so do you still divide by 2?

Or do you mean: (AB+CD+EF+GH+IJ+KL+MN+OP+QR+ST)/10  ?

Are we looking at an average of each iteration?  You lost me..

Each array should be added to the next and divided by the total number of arrays.  So like matlab code AB(1)+CD(1)+...../10 then AB(2)+CD(2)..../10 etc etc.  Until you have an array the same size as the original AB but the average across all iterations.  See ensemble average here:  http://www.numberwatch.co.uk/averages.htm

The Bode Plots still aren't as clear as I would like.  The upper (100rad/s+) frequencies just won't come out very clear, I think it has something to do with my Signal generator and step size.  You guys have helped tons though I really appreciate it.  How did you make the coherence and stuff so clear?  I am not sure how you did it.

Thanks!

Knight of NI
Posts: 10,210

# Re: array subset output malfunction

See the attached VI, which is your version with a slight modification.

I did not cleanup the code.  It is in LV 2010.

.
(starting to) See Life in a brand new way...

b* ^ )
Member
Posts: 24

Thank You!

Knight of NI
Posts: 10,210

# Re: array subset output malfunction

Did that work for you?

.
(starting to) See Life in a brand new way...

b* ^ )