It is currently Tue Jan 22, 2019 1:18 am

 All times are UTC - 7 hours

 Page 1 of 1 [ 10 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: MMC5 audio polarityPosted: Mon Jul 14, 2014 10:10 am

Joined: Sat Jan 22, 2005 8:51 am
Posts: 428
Location: Chicago, IL
The MMC5 audio page on the wiki states that "the polarity of all MMC5 channels is reversed compared to the APU."

What does that mean, exactly? Should the 0s and 1s in the APU's duty cycle sequences be swapped?

Code:
Duty    Waveform sequence
0   0 1 0 0 0 0 0 0 (12.5%)
1   0 1 1 0 0 0 0 0 (25%)
2   0 1 1 1 1 0 0 0 (50%)
3   1 0 0 1 1 1 1 1 (25% negated)

_________________
get nemulator
http://nemulator.com

Top

 Post subject: Re: MMC5 audio polarityPosted: Mon Jul 14, 2014 10:17 am

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7112
It means that if the NES squares produce a positive voltage on a "1", the MMC5 squares doing the equivalent thing will produce a negative voltage.

I would suggest inverting the output. Don't make changes to the internal digital logic before output. Simply exchanging 1 and 0 is not the right idea, as remember this squares also have a volume control. 0 should still output 0, and this makes a difference especially if you are simulating an analog filter on the output. If you could replace 1 with -1, that would be conceptually more like what you want, but it would only be the correct implementation if you are multiplying it with the volume and not using some boolean logic on the volume.

Top

 Post subject: Re: MMC5 audio polarityPosted: Mon Jul 14, 2014 10:26 am

Joined: Sat Jan 22, 2005 8:51 am
Posts: 428
Location: Chicago, IL
So the MMC5 is actually outputting a negative voltage?

_________________
get nemulator
http://nemulator.com

Top

 Post subject: Re: MMC5 audio polarityPosted: Mon Jul 14, 2014 10:44 am

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21007
Location: NE Indiana, USA (NTSC)
Yes. If your resampler can handle only unsigned signals, try subtracting the MMC5's output from 30.

Top

 Post subject: Re: MMC5 audio polarityPosted: Mon Jul 14, 2014 11:05 am

Joined: Sat Jan 22, 2005 8:51 am
Posts: 428
Location: Chicago, IL
Signed signals aren't a problem; I'll give it a try. Thanks, guys.

_________________
get nemulator
http://nemulator.com

Top

 Post subject: Re: MMC5 audio polarityPosted: Tue Jul 15, 2014 7:30 am

Joined: Sat Jan 22, 2005 8:51 am
Posts: 428
Location: Chicago, IL
This seems to work fine, but I have a couple of (maybe dumb) questions:
- Where is the MMC5's negative voltage source?
- Why doesn't this cause issues? For example, wouldn't similarly setup square waves on the APU and MMC5 cancel each other out?

tepples wrote:
try subtracting the MMC5's output from 30.

That's inverting the signal, though, not generating a negative signal...

_________________
get nemulator
http://nemulator.com

Top

 Post subject: Re: MMC5 audio polarityPosted: Tue Jul 15, 2014 7:45 am

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21007
Location: NE Indiana, USA (NTSC)
James wrote:
- Why doesn't [MMC3's inverted waveform] cause issues? For example, wouldn't similarly setup square waves on the APU and MMC5 cancel each other out?

They might cancel if they're exactly in phase, just as a 2A03 pulse wave with duty cycle \$40 (1/4) and one with duty cycle \$C0 (3/4) cancel. But in practice, such waves are rarely exactly in phase because they're playing different notes in the first place.

Quote:
That's inverting the signal, though, not generating a negative signal

There's no audible difference between the two.

Top

 Post subject: Re: MMC5 audio polarityPosted: Tue Jul 15, 2014 8:03 am

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7112
James wrote:
- Where is the MMC5's negative voltage source?
That's inverting the signal, though, not generating a negative signal...

Voltage isn't absolute, it's a relative difference. Whatever the baseline output of the 2A03 or MMC5 is, there is a highpass filter which shifts that baseline to ground (0). It doesn't need a negative voltage source, it only needs to go negative relative to its baseline output. Inverting and negating are the same thing in this situation.

Top

 Post subject: Re: MMC5 audio polarityPosted: Tue Jul 15, 2014 8:26 am

Joined: Sat Jan 22, 2005 8:51 am
Posts: 428
Location: Chicago, IL
ok -- I think I get it now. What you're saying is that, pre-highpass filter, whether the signal looks like this:
Code:
2A03
----
|    |
|    |
0v --------------------
|    |
|    |
----
MMC5

or this:
Code:
2A03
----
|    |
|    |
--      --      ----
|    |
|    |
----
MMC5

0v --------------------

the output post-highpass is the same. Right?

_________________
get nemulator
http://nemulator.com

Top

 Post subject: Re: MMC5 audio polarityPosted: Tue Jul 15, 2014 8:59 am

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7112
Yes, that is correct.

It's standard for a lot of audio devices to include a mild highpass filter to get rid of DC offset, because it can reduce amplifier headroom, cause inefficient use of power, or cause other problems for an audio system. You also can't hear a DC offset.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 10 posts ]

 All times are UTC - 7 hours

Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki