Need demo code for oversampling in PSOC 5LP?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello Every body,

   

Can any one provide me a demo code for oversampling my SAR output in PSOC 5LP.

   

I shall be very thankful to you.

   

 

   

Best Regards

   

Awais

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Nothing to do with code, only the sampling rate is of interest which can be selected for instance  by a timer signal

   

https://en.wikipedia.org/wiki/Oversampling

   

 

   

Bob

View solution in original post

0 Likes
13 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Nothing to do with code, only the sampling rate is of interest which can be selected for instance  by a timer signal

   

https://en.wikipedia.org/wiki/Oversampling

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

Actually i am very confusing it.

   

I am using SAR for ADC and before my signal pass through the Bandpass filter i want to do oversampling in order to increase my ADC output resolution from 12 bit to 14 bits.

   

For this, what i am thinking is to read ADC output, store it in a variable say "adc_output". Performs oversampling on  every 16 values and then pass it to the band pass filter.

   

Am i going right?

   

Looking forward for your suggestion

   

Awais

0 Likes
Anonymous
Not applicable

Hello Bob,

   

I am also trying to implement an elliptical low pass filter in psoc 5lp project. Is there any application note present how i can do that? I have no filter block left as i am also using two channel band pass filter.

   

Looking forward for your reply

   

Regards

   

Awais

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Not quite right.
Oversampling has nothing to do with the ADC resolution. Think of a digitized sine with frequency f0 output to a scope.

   

When you digitize with 2*f0 (Nyquist) you will just see a square wave with f0  

   

When you digitize with 20*f0 or even 50*f0 you will see a smooth curve on the scope. This is the effect of oversampling.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Ok, So this means if i want to get more smooth signal then i need to multiply my ADC output with a factor "n" right?

   

So then what should i do then, in order to increase my ADC resolution?

   

Awais

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

So this means if i want to get more smooth signal then i need to multiply my ADC output with a factor "n" right? Frankly: No

   

You will get a more smooth signal you have to take more samples/s

   

You cannot increase the resolution, it is a given property of the underlying ADC. When you take an ADC with 12 bit resolution you will have to take it.

   

You may use the Delta Sigma ADC with max. 20 bit resolution at the cost of only ~180 samples/s

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Moin Bob,

   

I mean using the method "IMPROVING ADC RESOLUTION BY OVERSAMPLING AND AVERAGING".

   

I think it is possible?

   

I cannot use Delta sigma because i need two of them which i don't have avaliable in PSOC.

   

 

   

Looking forward for your suggestion.

   

Regards

   

Awais

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello Bob,

   

I wrote the code for oversampling using shifting method also called decimation technique.

   

I experiment it with Deltasigma ADC could please have a look on it please and guide me if that is the correct thing or not? Looking forward for your valuable suggestion.

   

 

   

Best Regards

   

Awais

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Are you sure right project attached?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Yea i think so.

   

Its just an ADC with VDAC. I just try to implement over sampling in C file.

   

Awais

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I just try to implement over sampling in C file   Where and how are you implementing oversampling?

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello Bob,

   

I am following this document. Please see page 2 and 19 of it.

   

Regards

   

Awais

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Read page 11 to see that increasing the resolution only works for measuring DC, not for AC signals.

   

You can increase the precision  of an AD conversion by oversampling and averaging and you may reduce niose this way.

   

Read this article from Dave van Ess.

   

 

   

Bob

0 Likes