Find Optimal Kernel
by Matthew Nelson
19 Mar 2009
(Updated 25 Mar 2009)
Find optimal causal filter kernel that convolves with one time series to approximate another
|
Watch this File
|
| File Information |
| Description |
%function k=FindOptKern(InSig,OutSig,MaxnLags)
%
% Given InSig, OutSig, and the MaxnLags, this will find the optimal causal
% kernal of length MaxnLags that when convolved with InSig gives the
% optimal approximation to OutSig in a least squares sense.
%
% Note that this code produces the optimal causal kernel. the basic
% technique does not have to produce a causal kernel, but this code does.
%
% Input
% InSig: An N x 1 vector of the input signal (i.e. Trial type in the
% trial history example)
% OutSig: An N x 1 vector of the output signal (i.e. RT in the trial
% history example)
% MaxnLags: A scalar for the maximum number of lags to calculate up to.
% Must be less than the length of the signal.
%
% k: A MaxnLags x 1 vector of the optimal kernel.
%
% For an explanation of this, See Corrado, Sugrue, Seung and Newsome (2004)
% pp. 591-592
% Also see: http://hebb.mit.edu/courses/9.29/2004/lectures/lecture03.pdf
%
% by MJN on 090318 |
| Required Products |
Signal Processing Toolbox
|
| MATLAB release |
MATLAB 7.7 (R2008b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 25 Mar 2009 |
Indicated that matlab's signal processing toolbox is required for the code to work. (For the function xcov) |
| 25 Mar 2009 |
Added a separate script to test the output of FindOptKern. |
|
Contact us at files@mathworks.com