dcribeiro22

04-05-2011, 02:24 AM

Hi all,

'Kia Ora'!

Greetings from New Zealand!

We are PhD Students at the University of Otago and we want to calculate total power and median power frequency for COP during standing bipedal and unipedal task.

The total power calculation was based on Soeda et al paper (Exp Brain REs, 2003, 148:226-271).

We are having problems to 'cross-check' our results, specially, regarding total power value. The magnitude for total power is 0.41184.

This refers to a bipedal task, with 30 seconds of duration, fs = 400 Hz, COP measured in meters. The data has already been filtered (low pass, butterworth, 4th order, cutt-off frequency 10 Hz).

Currently, we are working with the code described below.

Would anyone be available to check if this code makes sense? Or maybe you may have a better solution?

We appreciate the attention and help.

Kind regards,

Daniel and Ram

------------------------------------

Octave/Matlab code:

close all

clear all

data = load('bipedal_offset.txt');

fs = 400; % Sample frequency (Hz)

m = length(data(:,2)); % Window length

n = 2^(nextpow2(m)); % Transform length

y = fft(data(:,2),n); % DFT

f = (0:n-1)*(fs/n); % Frequency range

p = y.*conj(y)/n; % Power of the DFT

[nl,nc] = size(data);

plot(f,p)

xlabel('Frequency (Hz)')

ylabel('Power')

title('{\bf Periodogram}')

total_power = sum(sqrt(p).^2)

'Kia Ora'!

Greetings from New Zealand!

We are PhD Students at the University of Otago and we want to calculate total power and median power frequency for COP during standing bipedal and unipedal task.

The total power calculation was based on Soeda et al paper (Exp Brain REs, 2003, 148:226-271).

We are having problems to 'cross-check' our results, specially, regarding total power value. The magnitude for total power is 0.41184.

This refers to a bipedal task, with 30 seconds of duration, fs = 400 Hz, COP measured in meters. The data has already been filtered (low pass, butterworth, 4th order, cutt-off frequency 10 Hz).

Currently, we are working with the code described below.

Would anyone be available to check if this code makes sense? Or maybe you may have a better solution?

We appreciate the attention and help.

Kind regards,

Daniel and Ram

------------------------------------

Octave/Matlab code:

close all

clear all

data = load('bipedal_offset.txt');

fs = 400; % Sample frequency (Hz)

m = length(data(:,2)); % Window length

n = 2^(nextpow2(m)); % Transform length

y = fft(data(:,2),n); % DFT

f = (0:n-1)*(fs/n); % Frequency range

p = y.*conj(y)/n; % Power of the DFT

[nl,nc] = size(data);

plot(f,p)

xlabel('Frequency (Hz)')

ylabel('Power')

title('{\bf Periodogram}')

total_power = sum(sqrt(p).^2)