开发者

shaping a signal using another signal

开发者 https://www.devze.com 2023-02-19 22:13 出处:网络
Greetings All I have a signal labeled 1) and I have another triangle signal labeled 2) that I woul开发者_运维百科d like to have it molded to (I don\'t want to filter the

Greetings All I have a signal labeled 1) and I have another triangle signal labeled 2) that I woul开发者_运维百科d like to have it molded to (I don't want to filter the signal just mold it to fit within the triangle shape). Does anyone know the best way to do this? Do I just multiply / add the signals together? here's the image link below http://dl.dropbox.com/u/6576402/Diagram1.jpg tia sal22

Here's some matlab/octave code I've tried like @mor22 suggested I post as you can see I tried a bunch of different y3 to see what happens.

%wave shapping
clear all
fs=1000; %sample frequence should be 44100 for cd quality

x=linspace(0,2*pi,fs);
y=sin(4*x);

%f3=max(min(f1,abs(f2)),-abs(f2))
y2=1*asin(sin (x+pi/2)); %arcsin creates comples number
y2=y2/abs(max(y2)); %make sure y2 is 1 or under 1
%y3=max(min(y,abs(y2)),-abs(y2));
%y3=y2.*y
y3=y2+y;
y3=y3/abs(max(y3)); %make sure y3 is 1 or under 1
plot(x,y,'g',x,y2,'r-',x,y3,'b*');

and a link to the image of the plot http://dl.dropbox.com/u/6576402/questions/Screenshot.png

The Green is the original signal. The Red sawtooth wave is the envelope I want it to follow/be bounded by. The blue is the final wave I'm having problems with

An example of what I'm trying to do with out the animation of course I just want the signal to be bounded like this, but bounded using a sawtooth wave I added the link below because I can only post one link as a new user ocw.mit.edu/courses/mechanical-engineering/2-062j-wave-propagation-fall-2006/simulations/group_velocity/grpvel.gif


This looks like a homework question, so I'll only lead you to the water. To understand signal shaping, just think of the function sinc(x)=sin(x)/x. This can be seen as a sin(x) shaped by the decay of a 1/x.

The figure below shows the sinc(x) curve in blue and ± 1/x in red. You can see that the zeros of the sinc(x) function are exactly the same as that of the underlying sin(x) function, i.e., . The decay of the 1/x shapes the sin(x) which results in the blue curve.

shaping a signal using another signal

You can now infer from the definition of sinc(x) above, whether you have to multiply the two functions or add them. If you do the same with sin(x) and abs(x), you get something like this

shaping a signal using another signal

If I misinterpreted your question and you indeed wanted to just attach the end points of the sine like curve to the end points of the abs(x) like curve, then that's not shaping. You probably just need to translate the entire curve such that the end points for both coincide.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号