/[marvin]/marvin/src/libsip/type/discsignal.cc
ViewVC logotype

Diff of /marvin/src/libsip/type/discsignal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by castor_fou, Tue Sep 16 20:38:46 2003 UTC revision 1.15 by srv89, Wed Sep 17 00:41:48 2003 UTC
# Line 111  DiscSignal &DiscSignal::concat ( DiscSig Line 111  DiscSignal &DiscSignal::concat ( DiscSig
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);
   assert(fst > 0 && snd > 0 && snd > fst);    
115    if (snd > this->length())    if (snd > this->length())
116      snd = length();      snd = length();
117    double        *dres = (double *)malloc(sizeof(double) * (snd - fst));    double        *dres = (double *)malloc(sizeof(double) * (snd - fst));
118    memcpy(dres, (this->get_data() + fst), snd - fst);    memcpy(dres, (this->get_data() + fst), sizeof(double) * (snd - fst));
119    DiscSignal *res = new DiscSignal(dres, snd - fst);    DiscSignal *res = new DiscSignal(dres, snd - fst);
120    return *res;    return *res;
121  }  }
122    
123    
124    DiscSignal &DiscSignal::windowing_size( unsigned fst, unsigned size ) const
125    {
126      if (fst < 0)
127        fst = 0;
128      if (size + fst >= length())
129        fst -= size + fst - length();
130      double        *dres = (double *)malloc(sizeof(double) * size);
131      memcpy(dres, (this->get_data() + fst), sizeof(double) * size);
132      DiscSignal *res = new DiscSignal(dres, size);
133      return *res;
134    }
135    
136    
137  DiscSignal &DiscSignal::hamming () const  DiscSignal &DiscSignal::hamming () const
138  {  {
139    int it;    int it;

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26