Emulation that enhances the originals

Page 5/5
1 | 2 | 3 | 4 |

By erikd

Master (255)

erikd's picture

15-01-2015, 19:43

Quote:

If a phase-shift free algorithm can be used, then this is a non-issue.

(Yes, I'm quoting myself here Wink)
Actually I think even in this case, doing the interpolating/filtering continuously will still yield better results.
For example if the waveform changes (which will probably rarely happen if the waveform is read exactly at the beginning), or if the output volume changes, interpolation will still be done (unlike when you only interpolate the SCC's wave memory).

By erikd

Master (255)

erikd's picture

15-01-2015, 20:07

Hi Wouter, I think we might be misunderstanding eachother a bit Smile
I appreciate the explanations, but (while perhaps not as much as you and Grauw) I do know a thing or 2 about DSP, and I do know what 'phase' is.

I was only making a case for doing filtering/interpolation continuously as opposed to only in SCC's internal wave memory, which I think Grauw was doing. Having phase-shifts will complicate things if you do that, and that's all I wanted to point out.
And even if that problem is solved, it doesn't solve other problems that only filtering/interpolating SCC's internal wave memory doesn't solve. That's all Smile

By Grauw

Ascended (10296)

Grauw's picture

15-01-2015, 20:49

I don’t know that much about it, I’m trying to learn and understand... I didn’t know for example that the phase shift caused by FIR filters is linear while the IIR’s phase shift isn’t. And thanks to the pointer to sinc interpolation I read and learned a lot about that yesterday (in the process affirming that the solution I came up with by myself was a good one ;p).

It’s an interesting and educational discussion! Smile Better understanding these things will help me create interesting SCC wave tables for Synthesix (maybe someone wants to help me @ Nijmegen Smile). I also want to make a wave table editing function for it featuring low pass filters on arbitrary waveforms, etc. Maybe even realtime filtering? Will have to see if performance is anywhere near acceptable for that.

I’m still investigating whether it’s practical or doable to use a FIR or IIR filter to do this low pass filtering on a waveform, because it’s faster than doing FFT transforms. The start/end of the waves, phase shift and feedback are topics to consider. I think I could match the start/end by duplicating the wave and taking the second half of the filter output, phase shift could afaik be canceled out with an all pass filter, and it seems I should probably avoid IIR filters because of the nonlinear phase shift, also I think they take multiple iterations to settle on the final value?

As for waveform / volume changes, not sure whether that’s a transition that needs to be filtered? What I like about the sinc-interpolation on the waveform is that it’s quite an “ideal” interpolation, and quite simple to implement (no changing frequencies to worry about).

By wouter_

Champion (470)

wouter_'s picture

15-01-2015, 20:56

Grauw wrote:

... I didn’t know for example that the phase shift caused by FIR filters is linear while the IIR’s phase shift isn’t.

Actually FIR filters can be made to have an arbitrary amplitude and phase response. But, if desired, it's relatively easy to give them a linear phase response. IIRC a FIR filter has a linear phase response if and only if its coefficients are symmetrical around the center coefficient. For example one with coefficients [1 -2 3 -2 1].

By erikd

Master (255)

erikd's picture

15-01-2015, 21:19

Quote:

It’s an interesting and educational discussion!

It certainly is Smile

Quote:

I’m still investigating whether it’s practical or doable to use a FIR or IIR filter to do this low pass filtering on a waveform, because it’s faster than doing FFT transforms.

FWIW, on my laptop (which is not the fastest one around by any stretch) I can run about 1500 simple 4th order IIR filters simultaneously on 64bit floats on a single core (in java, no less). Things will get more expensive with steeper filters, but still, performance is not that much of an issue if you want to do it in real-time, especially when you're coding more low-level than java.
Doing FFT transforms will be more costly, but still, we're talking about just 5 channels here.

If you want to go for the most perfect solution, I'd not shy away from doing it in real-time if I were you Smile

My attitude towards performance concerns is normally: Make it work in the best/cleanest way possible first, worry about performance later if there's a problem in that regard.

Quote:

As for waveform / volume changes, not sure whether that’s a transition that needs to be filtered?

That depends on how much it happens. I suspect in Konami games it happens often enough that it could be noticeable.
Maybe I can just do an analysis to see how much that happens, if that helps.

Anyway, if you're going for the cleanest solution by going with FFT transforms and such, then why not deal with that as well?
I still think interpolating/filtering the whole output of an SCC channel in real time will make things easier, and will sound better too (even if using a simple LPF). And if you do it all in real-time, phase shifts aren't really much of an issue.

By erikd

Master (255)

erikd's picture

15-01-2015, 21:48

Quote:

As for waveform / volume changes, not sure whether that’s a transition that needs to be filtered?

I just counted the number of volume changes during 1 minute of music in the Nemesis 3 intro: It's almost 6000 volume changes during one minute (across all 5 channels).
I didn't measure waveform changes.

Make of that what you will, but it does seem something not to ignore.

By fernando.collazo.5682

Master (256)

fernando.collazo.5682's picture

16-01-2015, 03:14

Maybe something like this:

Spec256 Emulator - ZX Spectrum Games in 256 colours
https://www.youtube.com/watch?v=xGN59bA1n3M

GameBoy Enhanced
https://www.youtube.com/watch?v=kbd7lGXfRxI

By erikd

Master (255)

erikd's picture

16-01-2015, 19:58

Yes, that stuff is pretty cool!

By erikd

Master (255)

erikd's picture

16-01-2015, 20:33

Hi Grauw, still working on your SCC interpolation stuff?

I've just done some experimenting myself with it, but with just simple IIR 8-pole LPF filters on the channel outputs (following their frequencies 5 octaves up, but I've also experimented with that).
While it certainly sounds smoother, it doesn't necessarily sounds 'better' to me (as in *subjectively* better). To me it just sounds a bit cleaner, but also less exciting/'fat'.
And that's with less-than-perfect filters, so I suppose some rogue harmonics still seep through.

If I were to pursue this further I'd probably add Exciters to the channels to 'tickle' harmonics again, but then again perhaps I should just keep the SCC as it is; crappy but awesome Smile
I mean this is what the original composers worked with; I suppose they made their music *work* with what they had, warts and all, and trying to clean that up perhaps takes something away from that.

Anyway, I'd still be interested to know what you can come up with using better algorithms.

Page 5/5
1 | 2 | 3 | 4 |