Dear Felix,
Here is some old code I have which creates the FLOBS and allows you to
vary the parameters to see what happens. The code is not very elegant
but I am sure you can figure it out.
best regards,
Jason
function [output Parameters] = generate_half_cosine_basis
% This generates an HRF using a series of half cosine functions.
% The parameter ranges are chosen
% I dont know what order refers to
order=14;
sampling_rate=0.05;
RT=3;
% These limits are those defined in the original FLOBS paper by Woolrich
c_lower=0;
c_upper=1;
c=rand*c_upper+c_lower; %0-0.3
m1_lower=0;
m1_upper=2;
m1=rand*m1_upper+m1_lower; %0-2
a1=0;
m2_lower=2;
m2_upper=8;
m2=rand*m2_upper+m2_lower;
a2=1;
m3_lower=2;
m3_upper=8;
m3=rand*m3_upper+m3_lower;
a3=1+c;
m4_lower=2;
m4_upper=8;
m4=rand*m4_upper+m4_lower;
a4=c;
Parameters = [c a1 a2 a3 a4 m1 m2 m3 m4 sampling_rate];
on_per_lower=0;
on_per_upper=0;
on_per_v=rand*on_per_upper+on_per_lower;
on_per=ones(1,round(on_per_v)/sampling_rate);
t1=[0:sampling_rate:m1];
y1=a1/2*cos(2*pi*1/(2*m1).*t1)-a1/2;
t2=[0:sampling_rate:m2-sampling_rate];
y2=-(a2+a1)/2*cos(2*pi*1/(2*m2).*t2)+a2/2-a1/2;
t3=[0:sampling_rate:m3-sampling_rate];
y3=a3/2*cos(2*pi*1/(2*m3).*t3)+a2-a3/2;
t4=[0:sampling_rate:m4-sampling_rate];
y4=-a4/2*cos(2*pi*1/(2*m4).*t4)-a4/2;
y=[y1 y2 on_per y3 y4];
% sub_samp_rate=RT/sampling_rate;
% samples=[0:sub_samp_rate:(order-2)*sub_samp_rate]'+1;
% output=[y(samples(find(samples<length(y))))
zeros(1,order-length(samples(find(samples<length(y)))))];
if length(y)<order*RT/sampling_rate
output=[y zeros(1,order*RT/sampling_rate-length(y))];
else
output=y(1:order*RT/sampling_rate);
end
On Mon, Nov 19, 2012 at 8:40 AM, Felix Schlegel
<[log in to unmask]> wrote:
> Could someone kindly tell me how
> the four half-cosine hrf equation looks like for the five parameters m1, m2, m3, m4 and c?
> I'd like to use this function to manually fit some measurements.
> Unfortunately I can't seem to find the equation in the woolrich 2004 paper.
> Thank you.
|