Optimal filtering of nerve singnals