Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > Filtering a signal

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Filtering a signal
Moderator:
RKRM

Post Reply
Follow this topic



Filtering a signal

zaq posted on 27 May 2012 2:12 PM PST
Senior Member
11 Forum Posts

 Project: ADC => DMA => Filter => DMA => DAC

The input is provided as a DTMF waveform signal. The amplitude is in range 0.2 ..2.2 V.

The problem is with output signal.  The waveform is rectangular(should be as a sine). It looks like the DAC is in saturation mode.

Thanks.




Re: Filtering a signal

Bob Marlowe posted on 27 May 2012 02:27 PM PST
Top Contributor
1768 Forum Posts

Sounds a bit like DAC is 4.080V but power is set to 3.3V.

Or can it be that you get the wrong byte from the filter?

 

Bob



Re: Filtering a signal

zaq posted on 28 May 2012 10:01 AM PST
Senior Member
11 Forum Posts

 I've tried DAC's range 4.080V and 1.020V the result is the same.


 

"Or can it be that you get the wrong byte from the filter?"

How can I check it?



Re: Filtering a signal

Bob Marlowe posted on 28 May 2012 11:29 AM PST
Top Contributor
1768 Forum Posts

Have a look into the datasheet, use the table on pg 21. I'm not experienced with that, but would use the 8-bit entry in the table.

Bob

 



Re: Filtering a signal

kiku posted on 29 May 2012 11:39 PM PST
Cypress Employee
61 Forum Posts

Hi.

 

From your project file, I understand that you are using Band Pass filter. In that case, we can't use DMA directly to move the output data from Filter's Holding register to DAC's data register.

As the ADC is operating between 0-Vdda, its output will have a DC component @ Vdda/2. In the Band pass filter, this DC component will be removed. So the output will be in signed format. But DAC accepts only unsigned numbers. So you need to add an offset of 128 (2^8/2 + 1 for 8 bit DAC) manually before passing the filter output to DAC.

You can add this offset in an ISR connected to the Interrupt pin of Filter component.

Note: The same method of adding offset is applicable to HPF as well because HPF also removes the DC component.

I've herewith attached a sample project for HPF where I'm explaining how to add the offset manually to the output of Filter. Look at this. This should help you.

 

Regards,

Kishore.



Re: Filtering a signal

zaq posted on 30 May 2012 06:59 AM PST
Senior Member
11 Forum Posts

 Hi,kiku!

You are absolutely right!!! Filter and DMA are working correctly only in "Low Pass Mode". For Band Pass and High pass we need to use "interrupt request".

I've used your example in my project and now my Band Pass Filter works properly.

 

And  I have one question more: Could I transfer signal from one ADC to Filter's Channel_A and Filter's Channel_B simultaneously with ISR? (I don't want to use two ADC. Iis it possible?)

Thanks.

zaq



Re: Filtering a signal

kiku posted on 31 May 2012 12:50 AM PST
Cypress Employee
61 Forum Posts

Hi Zaq,

 

Yes it is possible. Use the below code:

 

CY_ISR(adc_ISR)
{

    int8 adcResult;

    adcResult = ADC_SAR_GetResult8();

    Filter_Write8(Filter_CHANNEL_A, adcResult);

    Filter_Write8(Filter_CHANNEL_B, adcResult);
}

 

Regards,

Kishore.



Re: Filtering a signal

Amaro posted on 24 Aug 2012 01:56 PM PST

1 Forum Post





ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20