111 |
|
|
112 |
DiscSignal &DiscSignal::windowing( unsigned fst, unsigned snd ) const |
DiscSignal &DiscSignal::windowing( unsigned fst, unsigned snd ) const |
113 |
{ |
{ |
114 |
assert(fst > 0 && snd > 0 && snd > fst); |
|
115 |
|
assert(fst > 0 && snd > 0 && snd > fst); |
116 |
if (snd > this->length()) |
if (snd > this->length()) |
117 |
snd = length(); |
snd = length(); |
118 |
double *dres = (double*) memcpy(dres, (this->get_data() + fst), snd - fst); |
double *dres = (double *)malloc(sizeof(double) * (snd - fst)); |
119 |
|
memcpy(dres, (this->get_data() + fst), snd - fst); |
120 |
DiscSignal *res = new DiscSignal(dres, snd - fst); |
DiscSignal *res = new DiscSignal(dres, snd - fst); |
121 |
return *res; |
return *res; |
122 |
} |
} |