Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Any MATLAB Filter that changes cosine to sine?

Status
Not open for further replies.

testing test

Member level 3
Member level 3
Joined
Mar 3, 2010
Messages
65
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,288
Activity points
1,656
Hi,

I have a cosine input and I want it to multiply with a filter which changes the cosine to sine. The following code just plots a cosine signal. I want to multiple x with impulse response of a filter such that the output is a sine signal. Please help me design any such filter via coding.

Code:
N=100;
t=0:N;
f1=20;
fs=300;
x=cos(2*pi*f1/fs*t);
plot(t,x);

Thank you!
 

I would take advantage of the fact that
sin(x) = -dcos(x)/dt
The filter is then a simple differentiator...
y[n] = x[n] - x[n-1];
 
Can you please give me a few lines of MATLAB code for implementation of this filter?
 

y = filter([1, -1], 1, x);
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top