1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use PDL;
use PDL::Types;
use PDL::Func;
use PDL::Math;
use warnings;
use strict;
sub new
{
return (bless {
_signals => ['time', 'input'],
_parameters => ['count']
})->create(@_);
}
sub calc
{
my ($this, $dim, $time, $input, $count) = @_;
my $KDT = 62.9;
my $MDT = 0.6;
my $inputdelay = $this->delay('inputstate', $input);
my $output = $KDT*($input-$inputdelay)+(1+$MDT);
return ($output)
}
sub init
{
my ($this) = @_;
my $count = $this->{count};
$this->initdelay('inputstate', zeroes($count));
return 0;
}