|
"Elnaz " <ebsadeghian@gmail.com> wrote in message <jssinl$r5s$1@newscl01ah.mathworks.com>...
>
> > (2) Your sincs are shifted off center wrt the sampling locations by 0.1 and 0.2. This should make it so that the zero-crossings don't fall at the sample locations.
>
> Yes, this is due to the physical aspect of the problem I am modeling in MATLAB. And, this is fine. The only effect is that here instead of +1/-1, we'll have e.g. .95 or 1.12 but, again, whatever the number is it should appear exactly the same in both s and s1.
===========
OK, I've run your code. I see a very trivial difference between s and s1, a difference easily attributable to machine precision limits:
>> percentError=abs(s(51,51) - s1(101,101))/s(51,51)*100
percentError =
-8.0205e-014
Not sure why you expect to do better than this. I'm using my own implementation of sinc instead of the Signal Processing Toolboxes (I don't have that toolbox), but I doubt it matters. I too get a zero crossing error on the order of 1e-17.
> > (3) You are not using CONV2 with the 'same' option. That means the sample locations of "s1" won't coincide with the sample locations of "bits".
>
> I don't understand what you mean here. Could you explain a bit more?
===========
In hindsight, I don't think it matter. However, the way you're running CONV2 right now, you are extrapolating as well as interpolating. If you only want the convolution results in between the bits sample locations, you would use the syntax CONV2(A,B,'same')
|