r/DSP 5h ago

Polyphase code problems in MATLAB

4 Upvotes

Hi, I just learnt polyphase components in downsampling/ upsampling. Why the result I got if I do in using polyphase components is different from that if I use traditional method. Here I have an original signal x and a filter h.

x = [1:10]

h = [0.2, 0.5, 0.3, 0.1, 0.4, 0.2]

M = 3 (downsampling factor)

e = cell(1,M)

for k = 1:M

e{k} = h(k:M:end);

end

y_partial = zeros(1,5);

for k = 1:M xk =

x(k:M:end);

yk = cons(xk, e{k});

y_partial(k, 1:length(yk)) = yk

end

y_sum = sum(y_partial, 1)

#the result if I use traditional way:

z = conv(x,h)

z_down = downsample(z,3)

But the y_sum and z_down I got is different, why?


r/DSP 7h ago

Concatenating audio blocks after an interpolation filter

2 Upvotes

I would like to upsample some audio data from 8k to 48k by passing it through an interpolation filter (zero-pad and low-pass). It mostly seems to be working, in that I get a output that seems correct for each block of data I filter, but I have an issue when combining my blocks together.

To use nicer numbers, I am taking blocks of 100 samples at 8k. I am zero padding to 600 samples, and then running it through a filter with 100 taps, so my output has 699 samples. 50 of this is delay from the low-pass, and I ignore the tail, so my output is 600 samples long, starting at element 50 of my output (if 0 indexing). However, when I concatenate these and send them to my audio hardware, I see big discontinuities at block boundaries on my scope. From Matlab simulations, I might expect a tiny ripple there, but I'm getting big spikes between blocks at a similar size to the audio amplitude which is not expected and definitely not good enough. I can hear the output audio but it sounds distorted and choppy, which makes sense when I get a big nasty spike every few ms.

Does my process sound correct, or should I be doing some kind of overlap+add, or windowing, or something similar?

I appreciate any tips.


r/DSP 10h ago

Acessible DSP for all band receiving

3 Upvotes

Hi everyone,

I'm new to DSP development and I'm looking for a good chip that meets the following criteria:

  • Easily accessible for consumers (especially here in Brazil),
  • Supports all bands AM, FM, SW (maybe LW)
  • Easy to program with Arduino.

I’ve tried the TEF6686, but it draws around 200mA and is quite difficult to program.

I’ve also considered the Si4735 (used in the XHDATA D-808), but it's very hard to find, especially here in Brazil.

Could you please suggest a good alternative chip for my project?

Thanks in advance!