View Single Post
  #3 (permalink)  
Old 12-14-2004, 07:22 PM
David Kirkland
Guest
 
Posts: n/a
Default Re: Sample Rate Conversion (Downsampling)

Jaime Andrés Aranguren Cardona wrote:
> Hello,
>
> For a project which I'm working on, I have a 60Hz sinewave modulated with a
> square wave at 0.5Hz, modulation is 2.72%
>
> The signal comes sampled at 8kHz, I should downsample it to 200Hz, so M =
> 40. I do that in two stages, first with M1 = 10, then with M2 = 4. I
> implemented polyphase structure in Simulink, and runs great. By "great" I
> mean that the output signal, sampled at 200Hz, preserves the squarewave
> shape perfectly.
>
> Ths structure used in Simulink is the one in P.P. Vaidyanathan's book
> "Multirate Systems and Filter Banks", figure 4.3-4 (a), page 124.
>
> However, In my C implementation (on SHARC, BTW), the downsampled signal
> looks weird. By "weird" I mean that the envelope of the output signal,
> instead of being flat (square) as it is expected to be, seems more like a
> low frequency sinusoid, still it is noticeable when the amplitude rises and
> falls at the same frequency of the original modulating square wave.
>
> Given this information, and the fact that Simulink implementation maps
> directly to the figure in Vaidyanathan's book, I am pretty sure that I have
> some mistakes in my C implementation, but I can't find them.
>
> Could someone here please give me advice on what mistakes in implementing
> the polyphase M-fold decimation filters lead to the sort of "weirdness" that
> I got from my C implementation? That would be of much support in finding
> what I did wrong.
>
> If someone who desires to help me wants to have a look at the Simulink Model
> that I implemented, to the output of my C (for SHARC) implementation, and/or
> to my C implementation itself, please let me know, and I will be more than
> pleased in sending it to you.
>
> Kindest regards,
>
> --
> Jaime Andrés Aranguren Cardona
> [email protected]
> SanJaaC Electronics
> Soluciones en DSP
> www.sanjaac.com
>
> (Remove "nospam" from e-mail address)
>
>


You could also try a regular decimation implementation (instead of
polyphase) to see whether of not it's your polyphase filtering code.

Cheers,
David
Reply With Quote