Prev: world magnetic model 2010
Next: Error: Conversion to logical from cell is not possible whileusing imread
From: Yong on 27 Jan 2010 19:35 Dear all: I have some human performed sinusoid signals and would like to reshuffle all parts within a sinus so as to construct a new sinus with same characteristics at least in the amplitude and frequency domains. For example, a sinus has a frequency from 0.6 to 1 Hz and amplitude from 2 to 8. Could anybody help me to work it out please? The idea I am trying now is to simply identify all peaks and valley of the sinus then reshuffle all these pieces and reconnect them and smooth it in the end. Is it an option at all? If not, what would be other options? Thank you very much in advance! Sincerely yours, Yong Li, PhD
From: Walter Roberson on 27 Jan 2010 19:52 Yong wrote: > I have some human performed sinusoid signals and would like to reshuffle > all parts within a sinus so as to construct a new sinus with same > characteristics at least in the amplitude and frequency domains. For > example, a sinus has a frequency from 0.6 to 1 Hz and amplitude from 2 > to 8. Could anybody help me to work it out please? > The idea I am trying now is to simply identify all peaks and valley of > the sinus then reshuffle all these pieces and reconnect them and smooth > it in the end. Is it an option at all? If not, what would be other options? No, that is not an option. If you have to smooth anything then you have created a sharp transition, and at that transition, you will need signals that are outside of the original frequency domain. For example, a single sharp edge requires infinite frequencies to represent (in theory). If your results are in fact to fit within the original frequency range, then an FFT of the original signal and an FFT of the shuffled signal must both have components only within the the desired frequency band (though any particular frequency might have had its amplitude or phase altered.) I suspect you will find that that is a quite difficult constraint to maintain if you do the equivalent of taking snippets of the signal and shuffling them around. Try it yourself with a simple case and see what you get for the FFT of the altered signal.
From: TideMan on 27 Jan 2010 20:28 On Jan 28, 1:35 pm, "Yong " <yongl...(a)gmail.com> wrote: > Dear all: > > I have some human performed sinusoid signals and would like to reshuffle all parts within a sinus so as to construct a new sinus with same characteristics at least in the amplitude and frequency domains. For example, a sinus has a frequency from 0.6 to 1 Hz and amplitude from 2 to 8. Could anybody help me to work it out please? > > The idea I am trying now is to simply identify all peaks and valley of the sinus then reshuffle all these pieces and reconnect them and smooth it in the end. Is it an option at all? If not, what would be other options? > > Thank you very much in advance! > > Sincerely yours, > > Yong Li, PhD Maybe what you mean is phase randomisation? It preserves the 2nd order statistics and spectrum. Have a look here: http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/7c79d85c674df99b/a72e3b2148ca2ff3?lnk=gst&q=phase+randomisation#a72e3b2148ca2ff3
From: Yong Li on 28 Jan 2010 11:07 Thanks TideMan! The phase randomisation works well in the frequency domain but the amplitude was changed too much! I have save the link in my knowledge base for the future application. Please see my reply to Walter (above) for my latest exploration! Best regards, Yong TideMan <mulgor(a)gmail.com> wrote in message <7d50d1db-a4f3-4535-8b1f-eb325ba703fd(a)a32g2000yqm.googlegroups.com>... > On Jan 28, 1:35 pm, "Yong " <yongl...(a)gmail.com> wrote: > > Dear all: > > > > I have some human performed sinusoid signals and would like to reshuffle all parts within a sinus so as to construct a new sinus with same characteristics at least in the amplitude and frequency domains. For example, a sinus has a frequency from 0.6 to 1 Hz and amplitude from 2 to 8. Could anybody help me to work it out please? > > > > The idea I am trying now is to simply identify all peaks and valley of the sinus then reshuffle all these pieces and reconnect them and smooth it in the end. Is it an option at all? If not, what would be other options? > > > > Thank you very much in advance! > > > > Sincerely yours, > > > > Yong Li, PhD > > Maybe what you mean is phase randomisation? > It preserves the 2nd order statistics and spectrum. > > Have a look here: > http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/7c79d85c674df99b/a72e3b2148ca2ff3?lnk=gst&q=phase+randomisation#a72e3b2148ca2ff3
From: Yong Li on 28 Jan 2010 11:28
Hi Walter & TideMan, Thank you so much for your help! There are some progresses I made after I got your messages. I have rethought about the objective and the possible data features of my project carefully. I am manipulating human behavioral data, which means the minimum time interval for data changes around 200ms due to the latency of our reaction time. Therefore, the definition of randomization here is very loose relative to other approaches. So I simply pseudo-randomize blocks of signals, i.e., data in seconds, with a cut at the median amplitude. Then I reconstitute pseudo-randomized blocks with a simple low pass filter. In this way, the whole amplitude distribution was well preserved with a certain level of noise in the frequency domain. After try it by myself, I think these frequency changes were hardly detected by the naked eyes, or even detectable, it will be hard to affect the performance of our subjects. I post my rough code here. Please comment on it if you like! I do appreciate your support! %----------------------------------------------------------------------------------- function Block_reshuffle() % script to explore the reshuffling of acquired sinusoid % Yong Li January 28, 2009 %% RS signal load RS.asc; data = RS; Data = data - median(data); [z,nz]=zero_crossings(Data); WinLv = []; for i = 1:nz if data(z(i)+1)<data(z(i)); WinLv = [WinLv z(i)]; end end RWinLv = randperm(length(WinLv)-1); ReconT = []; for i = 1:length(RWinLv) Rtmp = WinLv(RWinLv(i)):WinLv(RWinLv(i)+1)-1; ReconT =[ReconT Rtmp]; end RD = [data(1:z(1)-1); data(ReconT); data(z(end):end)]; n = 2; Wn = 20/1000; [b,a] = butter(n,Wn); ReconD=filtfilt(b,a,RD); figure; plot(data); hold on; plot(ReconD, 'g'); hold off; %=================================== Warm regards, Yong Walter Roberson <roberson(a)hushmail.com> wrote in message <hjqn43$dii$1(a)canopus.cc.umanitoba.ca>... > Yong wrote: > > > I have some human performed sinusoid signals and would like to reshuffle > > all parts within a sinus so as to construct a new sinus with same > > characteristics at least in the amplitude and frequency domains. For > > example, a sinus has a frequency from 0.6 to 1 Hz and amplitude from 2 > > to 8. Could anybody help me to work it out please? > > > The idea I am trying now is to simply identify all peaks and valley of > > the sinus then reshuffle all these pieces and reconnect them and smooth > > it in the end. Is it an option at all? If not, what would be other options? > > > No, that is not an option. If you have to smooth anything then you have > created a sharp transition, and at that transition, you will need > signals that are outside of the original frequency domain. For example, > a single sharp edge requires infinite frequencies to represent (in theory). > > If your results are in fact to fit within the original frequency range, > then an FFT of the original signal and an FFT of the shuffled signal > must both have components only within the the desired frequency band > (though any particular frequency might have had its amplitude or phase > altered.) I suspect you will find that that is a quite difficult > constraint to maintain if you do the equivalent of taking snippets of > the signal and shuffling them around. Try it yourself with a simple case > and see what you get for the FFT of the altered signal. |