Shifting a wave in time domain in simulink

how to shift a wave in the time domain?? My situation:-i have a wave which has a some variations initially (say till time is 2) after this settling time i get my required stable wave..So i want to shift the signal like the value at time 2 must be assigned to time 0..and this signal i want it on the scope...
Transport delay or getting a zero till time 2 does not help..i want the wave to start from 2 itself
i think i am clear on my question...if you want some clarifications in the questions plz comment...
Awaiting for an answer from you folks...

답변 (2개)

Fangjun Jiang
Fangjun Jiang 2011년 8월 9일

2 개 추천

Set your simulation start time at 2.

댓글 수: 10

Starting simulation at 2 will not solve my frequency problem...i am only able to eliminate the signal upto 2 on my scope....see my last comment above..about the sinestream...i think that will give you an exact picture of my problem....if any clarification is needed,plz let me know...
Fangjun Jiang
Fangjun Jiang 2011년 8월 10일
Both Kaustubha and I had hard time understanding your use case. When you run simulation, everything starts at t=0. If you want to ignore the first 2 seconds of a particular signal. You have a few options.
1. Pre-process that signal data, truncate the first 2 seconds and then feed it into your model.
2. Run your simulation as normal but ignore the first 2 seconds
Hi all,
I think i have got you all confused on my present problem.First of all sorry for that...
Actually I tried to simplify the problem and tried to present it to you in a simple way..But it is happening the other way round,it is getting much complex and i am searching for some other thing and answers by you are going some other way...Its probably my inability to express my problem...
Forget about all what i said above...Think this as a new question itself
Terms:-Sinestream with 2 signals ie 1st signal and 2nd signal
Description:-
Imagine you have a sine stream of only 2 frequencies
So the wave has one frequency for a certain time(ie the 1st signal) and another frequency for the rest of the time(ie the 2nd signal)
i dont know the frequency of both the signals in the sinestream
Only thing i know is the 1st signal of the sinestream has only 2 complete cycles and the 2nd signal in the sinestream will continue till the stop time of the simulation
My intention here is to remove the 1st 2 cycles of the signal and get only the 2nd signal of the sinestream and i want the second signal exactly from its starting point
Starting my simulation at a certain time to remove the 1st signal wont work because i cannot find the exact point to start so as to not to truncate any part of the 2nd signal of the sinestream
Finally what i think is a solution to my problem is
check the zero crossings and eliminate signal till 4 zero crossings(which will eliminate the 2 cycles-ie the 1st signal) and get the signal from the 5th crossing onwards
by this i will probably eliminate my 1st signal and get only the second signal....But i dont know how to implement this in simulink
Plz suggest ideas or suggest your idea
Thank you very much for your support(both of you Kaustubha and Fangjun)
Fangjun Jiang
Fangjun Jiang 2011년 8월 11일
That's the problem, Vinol! In your original question, you said that you wanted to start at t=2. Now you said that you couldn't know the time but it was 2 cycles. Anyway, how is the signal coming to your model, or how is this signal generated in your model?
a sine wave passing through a transfer function of a rc high pass filter block gives this output
Fangjun Jiang
Fangjun Jiang 2011년 8월 11일
Is it possible that you run a simulation with that sine wave and transfer function alone to collect the output signal data? Then you can process the output signal data and use it for your model. I know this is kind cumbersome but I really don't have any other solution.
Yeah..I see the signal on a scope..but How do i collect the signal data and process it????
Fangjun Jiang
Fangjun Jiang 2011년 8월 12일
You can use the "To Workspace" block. It will save your signal data to a workspace variable. Then you can truncate the first 2-cycle data. Then use a "From Workspace" block to import the processed data form workspace to your Simulink model.
Hoe do i get to know as to till what value i have to truncate...I mean how can one exactly truncate 2 cycle data without knowing its frequency....
Fangjun Jiang
Fangjun Jiang 2011년 8월 16일
As you suggested earlier, use zero-crossing. You could visually inspect it if it just needs to be done occasionally. Or you can write a m-function to automate it. There got be a way. Otherwise, if there is no manual solution, how could a computer knows how to do it.

댓글을 달려면 로그인하십시오.

Kaustubha Govind
Kaustubha Govind 2011년 8월 6일

1 개 추천

The best you can do is to actually use a zero signal until time=2 and then switch to your actual signal - this can be done by using the Switch block where the control signal is driven by comparing the output of the Clock block to time>=2sec. One input is a constant zero and the other input is your actual signal.
Note that it does not make sense to have you signal start at time=2 itself. Since simulation starts at time=0, you need to provide your model some signal. You can always analyze your outputs such that everything for time<2sec is ignored.

댓글 수: 7

Hi Kaustubha,
Thank you for your suggestion..
what i am actually looking for is i dont want the signal till time equal to 2....i just want to have the wave from2 onwards..i need to compare this signal with other signal too...Which when compared with the signal starting from time 2 the model would work great...but with this initial stabilizing wave,i dont get the desired results...
For eg,if i take your answer as right,i would be comparing other signals with the signal i want at their respective time say signals at time 2 to signal(which we are discussing) at time 2 itself....actually i want to compare the signals at time 2 with my signal(one we are discussing) at time 0...which is what i want...
help me out please....
Perhaps you can delay your other signal (which is in a good state at t=0) also by 2secs. That way, all valid processing of your system starts at t=2sec. Otherwise, if you are importing you signals from the MATLAB workspace, you can always process your input signal in MATLAB before importing it into your Simulink model.
One more question
Answering this question might just solve my problem...
Is ther any method by which i can detect the time at which my signal crosses a certain level(say zero crossing)..remmber i want to measure the time when it crosses Zero...
Yes. The "Hit Crossing" block does what you need.
I am sorry for troubling you again....
ohhK...I will try to give an very detailed explaination of the situation i am in...
I have a signal which is like a sinestream,of 2 different frequencies..
the 1st cycle of the signal has one frequency and from the 2nd cycle onwards till the end the same signal has a differnt frequency...i want to eliminate this 1st cycle and even i dont know its frequency...its like i want to remove only the 1st cycle and i want the signal only from the 2nd cycle...the difference in frequency troubles all the signal processing carried on the signal further..
i tried a lot of things ...but in vain...
Someone please answer my question...I am refreshing this page every hour eager to find replies...
Hi all,
I think i have got you all confused on my present problem.First of all sorry for that...
Actually I tried to simplify the problem and tried to present it to you in a simple way..But it is happening the other way round,it is getting much complex and i am searching for some other thing and answers by you are going some other way...Its probably my inability to express my problem...
Forget about all what i said above...Think this as a new question itself
Terms:-Sinestream with 2 signals ie 1st signal and 2nd signal
Description:-
Imagine you have a sine stream of only 2 frequencies
So the wave has one frequency for a certain time(ie the 1st signal) and another frequency for the rest of the time(ie the 2nd signal)
i dont know the frequency of both the signals in the sinestream
Only thing i know is the 1st signal of the sinestream has only 2 complete cycles and the 2nd signal in the sinestream will continue till the stop time of the simulation
My intention here is to remove the 1st 2 cycles of the signal and get only the 2nd signal of the sinestream and i want the second signal exactly from its starting point
Starting my simulation at a certain time to remove the 1st signal wont work because i cannot find the exact point to start so as to not to truncate any part of the 2nd signal of the sinestream
Finally what i think is a solution to my problem is
check the zero crossings and eliminate signal till 4 zero crossings(which will eliminate the 2 cycles-ie the 1st signal) and get the signal from the 5th crossing onwards
by this i will probably eliminate my 1st signal and get only the second signal....But i dont know how to implement this in simulink
Plz suggest ideas or suggest your idea
Thank you very much for your support(both of you Kaustubha and Fangjun)

댓글을 달려면 로그인하십시오.

제품

질문:

2011년 8월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by