Revision 23:6cce421531e2 MAP/MAP1_14.m

View differences:

MAP/MAP1_14.m
610 610
        else    % no MOC available yet
611 611
            MOC=ones(1, segmentLength);
612 612
        end
613
        plot(MOC) % current channel
613
        % apply MOC to nonlinear input function       
614
        nonlinOutput=stapesDisplacement.* MOC;
614 615

  
615
        %       first gammatone filter
616
        %       first gammatone filter (nonlin path)
616 617
        for order = 1 : GTnonlinOrder
617 618
            [nonlinOutput GTnonlinBdry1{BFno,order}] = ...
618 619
                filter(GTnonlin_b(BFno,:), GTnonlin_a(BFno,:), ...
619
                stapesDisplacement, GTnonlinBdry1{BFno,order});
620
                nonlinOutput, GTnonlinBdry1{BFno,order});
620 621
        end
621

  
622 622
        %       broken stick instantaneous compression
623
        % nonlinear gain is weakend by MOC before applied to BM response
624
        y= nonlinOutput.*(MOC* DRNLa);  % linear section.
625
        % compress those parts of the signal above the compression
626
        % threshold
627
        abs_x = abs(y);
623
        y= nonlinOutput.* DRNLa;  % linear section.
624
        % compress parts of the signal above the compression threshold
625
        abs_x = abs(nonlinOutput);
628 626
        idx=find(abs_x>DRNLcompressionThreshold);
629 627
        if ~isempty(idx)>0
630
            y(idx)=sign(y(idx)).*...
631
                (DRNLb*abs_x(idx).^DRNLc);
628
            y(idx)=sign(y(idx)).* (DRNLb*abs_x(idx).^DRNLc);
632 629
        end
633 630
        nonlinOutput=y;
634 631

  
......
1111 1108
                    [smoothedRates, MOCboundary{idx}] = ...
1112 1109
                        filter(MOCfilt_b, MOCfilt_a, rates(idx,:), ...
1113 1110
                        MOCboundary{idx});
1111
                    % spont 'rates' is zero for IC
1114 1112
                    MOCattSegment(idx,:)=smoothedRates;
1115 1113
                    % expand timescale back to model dt from ANdt
1116 1114
                    x= repmat(MOCattSegment(idx,:), ANspeedUpFactor,1);

Also available in: Unified diff