Help with Constant Q Graphical Equalizer Design

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hi,

Well did you try a test signal that just starts out at low frequency and then gets higher little by little? That may shows a lot.
No I didn't but that's a good idea.
That was just something I noticed when I was testing it in spice and was wondering how to cope with it in the real world for different audio signals with varying amplitudes.

Speaking of spice I ran it for q=2, and the ripple is much smaller as expected, looks roughly to be about 1dB of ripple.

Will test it with some audio signals and see how it sounds.

Will also try it for various EQ settings...of course when I figure out how to do that in Spice lol. So far I only know how to set all the sliders at once to a particular position, not sure how to do them individually as yet.
 

Attachments

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Talked to my lecturer about the ripple and he said it's no problem as its expected.
He told me i can stick with q=4.

So im gonna add in all 15 filters on maple and try different levels of boost and cut and see what happens.

Will post those results once im done with that as well.
 

MrAl

Joined Jun 17, 2014
13,704
Talked to my lecturer about the ripple and he said it's no problem as its expected.
He told me i can stick with q=4.

So im gonna add in all 15 filters on maple and try different levels of boost and cut and see what happens.

Will post those results once im done with that as well.
Hi,

Oh that's good. I thought you had some personal reason for not liking the ripple too.
 
Hello Ronaldo,

If you don't mind my asking and you divulging answers, for what class or requirement is this project? Is this your senior project as an undergrad or is this something for a masters or higher? Do you actually have to build hardware? Will a simulation suffice or must you derive transfer functions too?

The Electrician and were discussing this and it made me curious to know because, in interviewing quite a number of senior EE students and recent graduates for internships and as potential new hires, most, if not all, had nowhere near the sophistication, experience and wherewithall to do what you are doing (even many fresh graduates with advanced degrees would be sweating). It seems you understand well the electronics behind what you are doing and that seems quite unusual for many modern day EE students, at least to what I've seen. Are you an older student with industry experience perhaps? Just curious.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hello Ronaldo,

If you don't mind my asking and you divulging answers, for what class or requirement is this project? Is this your senior project as an undergrad or is this something for a masters or higher? Do you actually have to build hardware? Will a simulation suffice or must you derive transfer functions too?

The Electrician and were discussing this and it made me curious to know because, in interviewing quite a number of senior EE students and recent graduates for internships and as potential new hires, most, if not all, had nowhere near the sophistication, experience and wherewithall to do what you are doing (even many fresh graduates with advanced degrees would be sweating). It seems you understand well the electronics behind what you are doing and that seems quite unusual for many modern day EE students, at least to what I've seen. Are you an older student with industry experience perhaps? Just curious.

Ohhh no its cool
Im an EE student in my final year ...undergrad

This project is for my final year project.
But yes I have to build the entire thing with a digital interface to adjust boost and cut by replacing the pots with digital pots.
Final product has to be on a PCB as well.

Oh and nope...no industry experience or anything...I started uni straight out of high school.


@Mr Al nah I didnt have a problem with it...just wanted to make sure he didn't . But i wouldn't have had a problem if i had to reduce the ripple though.
 
Hello Ronaldo,

Well, I am mightily impressed with your skill level. ;)

Don't what your situation is, but it seems that many universities have their EE students work in large cooperative groups these days. Perhaps this is intended to be similar to the working environment in industry. Whether this is true is debatable, but a very undesirable result of the group work paradigm is that it is far too easy for students to graduate without learning a balanced skill set. There may be only one student in a group who understands analog electronics. Then, because he can do that part of the work for the others, they may never have any motivation to get any hands-on working exposure to analog at all. These digital and software "specialists" may then graduate barely knowing what a capacitor is and with absolutely no clue how an inductor behaves. I wonder if this group project mentality is a way to make certain difficult, dry disciplines (such as EE) more approachable for female students? Hmm.

Regarding your project, the fact that you will be using digital pots controlled by virtual software sliders via a digital interface should allow you to completely overcome the group magnitude-bleed-over effect that results from adjacent frequency bands being boosted or cut together. You would just need a computational algorithm or empirically derived table to compensate the digital pot settings so that the end result is a transfer curve that matches the visual physical settings of the virtual sliders. Also, since this is a one-off project, you might consider cascading two opamp circuits in series for each frequency band, i.e., a high pass stage and a low pass stage (these could be two or three pole Butterworth configurations with a flat plateau in the middle of the pass band that is no longer strongly tied to the steepness of the skirts).
 
Last edited:

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hello Ronaldo,

Well, I am mightily impressed with your skill level. ;)

Don't what your situation is, but it seems that many universities have their EE students work in large cooperative groups these days. Perhaps this is intended to be similar to the working environment in industry. Whether this is true is debatable, but a very undesirable result of the group work paradigm is that it is far too easy for students to graduate without learning a balanced skill set. There may be only one student in a group who understands analog electronics. Then, because he can do that part of the work for the others, they may never have any motivation to get any hands-on working exposure to analog at all. These digital and software "specialists" may then graduate barely knowing what a capacitor is and with absolutely no clue how an inductor behaves. I wonder if this group project mentality is a way to make certain difficult, dry disciplines (such as EE) more approachable for female students? Hmm.

Regarding your project, the fact that you will be using digital pots controlled by virtual software sliders via a digital interface should allow you to completely overcome the group magnitude-bleed-over effect that results from adjacent frequency bands being boosted or cut together. You would just need a computational algorithm or empirically derived table to compensate the digital pot settings so that the end result is a transfer curve that matches the visual physical settings of the virtual sliders. Also, since this is a one-off project, you might consider cascading two opamp circuits in series for each frequency band, i.e., a high pass stage and a low pass stage (these could be two or three pole Butterworth configurations with a flat plateau in the middle of the pass band that is no longer strongly tied to the steepness of the skirts).
Thanks man!

I think group projects are just easier on the lecturers to mark etc (1 report per group vs a bunch per individual student).
But all of our hardware projects were individual ones. Group projects are normally simulation stuff or research stuff...for us atleast.
I favour the electronics though...integrated with some software. Strictly software projects are extremely boring for me...which is why I chose this EQ project for my fyp :D

Regarding the female students...errrr...there are some serious ones. The slack ones just copy their stuff from the dudes who know their stuff lol

Will look into your approach in the last paragraph...been busy this past week with a group project (hahaha) for another course that's due soon in the next week. Once that's over i'll switch back to this. Not sure if i'll be able to finish the Maple simulations for all 15 filters this weekend..will try though!
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Bummed out that I didnt get to work on it much since.
I've got finals next week so it's in pause until well next week when finals are over :(

I do have some questions about actually choosing components for the actual build but i'll post them up next week when I have some more time
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Finals are over so i'm finally back to working on Final Year Project.
I added in all 15 filters and did a small comparison between Q=2 and Q=4 to observe what happens. Q=2 gives a smoother response compared to Q=4. For Q=4, it gets like that when all filters are present, if i remove say the first 3 filters, it looks normal for Q=4, that is with the ~3dB ripple between them. Lecturer said it's okay anyways. But I guess its still good to show what happens when you change the Q for the hardcopy write-up.

Anyways, I'm going to start work on the digital interface from today (designing etc). Regarding choosing components, any tips for that? I'm pretty sure i'm not going to find exact values for those resistors I calculated (I will for the caps since I used standard value caps), so for the resistors i'm assuming I choose the closest values to them in real life with the smallest tolerances? ( Already a source of error)

Also what about the op-amps? What are somethings I should look for when choosing them? The original designer of the circuit used NE5532 (I think) op-amps but did not provide any rationale for doing so.
 

Attachments

Finals are over so i'm finally back to working on Final Year Project.
I added in all 15 filters and did a small comparison between Q=2 and Q=4 to observe what happens. Q=2 gives a smoother response compared to Q=4. For Q=4, it gets like that when all filters are present, if i remove say the first 3 filters, it looks normal for Q=4, that is with the ~3dB ripple between them. Lecturer said it's okay anyways. But I guess its still good to show what happens when you change the Q for the hardcopy write-up.
How did you produce these plots (LTSpice or Maple, or something else)? The curves are very jagged, a clear sign that you're having problems with numerical precision.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
How did you produce these plots (LTSpice or Maple, or something else)? The curves are very jagged, a clear sign that you're having problems with numerical precision.
Maple
I think its a precision thing though.
Spice plots it way smoother than this.

The thing about spice is that im not sure how to adjust each slider separately.
I can boost all at once or cut all at once but not vary them individually :(
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
I've decided to use this digital pot to replace the slide pots.
https://www.renesas.com/us/en/www/doc/datasheet/x9c102-103-104-503.pdf

Along with a 1 to 16 demux.

15 of the 16 demux lines will go to the CS pin on each of the pot. and i'd tie all the INC and U/D pins together to go to the arduino. That way I can select a pot through the demux by manipulating the select lines of the demux and then increment or decrement its rating through the arduino.

Will do up a block diagram for it and try playing around with some test sketches for it as well.
(Don't have components as yet wanna make sure everything is sound before I purchase parts. My lecturer wanted me to implement the digital interface on a touchscreen so i'll have to get one of those as well soon.)

Will start looking to designing a psu for the system as well to power these op-amps, it's gonna have to be a bipolar PSU.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
So I finally got parts...still waiting on some more digital pots to arrive. But i'm working on the digital interface rn. Also plan on actually building the analog part of the EQ between this week and next week and start testing it.

Here's my hardware setup for the digital interface.

I already have all the 15 sliders printing to the touchscreen, scrolling for each slider already works too. Just working out scaling it for the resolution of the pots.
 

Attachments

MrAl

Joined Jun 17, 2014
13,704
So I finally got parts...still waiting on some more digital pots to arrive. But i'm working on the digital interface rn. Also plan on actually building the analog part of the EQ between this week and next week and start testing it.

Here's my hardware setup for the digital interface.

I already have all the 15 sliders printing to the touchscreen, scrolling for each slider already works too. Just working out scaling it for the resolution of the pots.
Hi,

Nice to hear you have made some progress.
Maybe you could make a wave file too eventually of some tests with some test frequencies.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hi,

Nice to hear you have made some progress.
Maybe you could make a wave file too eventually of some tests with some test frequencies.
I'm freaking out right now.
I've been testing the digital pots.
End to end resistance I get 100-120k which is okay since the spec sheet said 20% tolerance for end to end resistance.

Now when i'm using the arduino to increment the wiper, I only get it to go up to about 75k, some goes up to 88k, some even 50-60k.
One went up to 100k. Now it isn't doing it anymore, its going up to about 80k
I'm not sure why this is happening, or if I need to reorder new pots which would take about 2 weeks to arrive :(

This is the code i'm using to test.

int PIN = 13;

void setup() {
pinMode(PIN, OUTPUT);
}

void loop() {
int state = 0;

while(1) {
if(state == 0) {
digitalWrite(PIN, LOW);
state = 1;
}
else {
digitalWrite(PIN, HIGH);
state = 0;
}
delay(150);
}
}

PIN 13 connects to INC
and i'm measuring the resistance between Vw and Vl
 
Last edited:

MrAl

Joined Jun 17, 2014
13,704
Hello again,

Well i do know you have to keep the supply voltage to the pot correct.
Also, how are you measuring the resistance?
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hello again,

Well i do know you have to keep the supply voltage to the pot correct.
Also, how are you measuring the resistance?
I'm using the 5V output of the arduino to power it.
Im measuring the resistance with a multimeter.
Im measuring it between Vl and Vw.
 

MrAl

Joined Jun 17, 2014
13,704
I'm using the 5V output of the arduino to power it.
Im measuring the resistance with a multimeter.
Im measuring it between Vl and Vw.
Hi,

Are you allowed to have a voltage of those terminals that is floating? An Ohm meter would be introducing a voltage that is floating relative to the supplies of the chip itself.
Could you test it using a resistor and the existing +5v power supply? See if you can get it to follow a voltage divider law for example.
I mention this because the spec on the terminals looks like -5v to +5v, but that implies a reference voltage somewhere of 0v.
Try the other test and see if it works out better.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hi,

Are you allowed to have a voltage of those terminals that is floating? An Ohm meter would be introducing a voltage that is floating relative to the supplies of the chip itself.
Could you test it using a resistor and the existing +5v power supply? See if you can get it to follow a voltage divider law for example.
I mention this because the spec on the terminals looks like -5v to +5v, but that implies a reference voltage somewhere of 0v.
Try the other test and see if it works out better.

Ohh so you're saying I should maybe ground them and see?
This was the approach I was using:


I'll also try the voltage divider and see what happens.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hi,

Are you allowed to have a voltage of those terminals that is floating? An Ohm meter would be introducing a voltage that is floating relative to the supplies of the chip itself.
Could you test it using a resistor and the existing +5v power supply? See if you can get it to follow a voltage divider law for example.
I mention this because the spec on the terminals looks like -5v to +5v, but that implies a reference voltage somewhere of 0v.
Try the other test and see if it works out better.
It worked!

I tied Vh to 5V(...well 4.7V) and Vl to GND and the wiper swings from 0V to 4.7V when I adjust the level of the sliders on the touchscreen.

Thanks man :D

Now all is left is for me to build the Analog EQ portion and integrate it with this.
Will keep posted as usual.
 
Top